main 602baa7

requests_generated.go RawHistoryFolder

1// Code generated by xtgen; DO NOT EDIT.
2package render
3
4import "bnema.dev/xturbo/xproto"
5import "encoding/binary"
6import "math/bits"
7import "bnema.dev/xturbo"
8
9func QueryVersion(b *xturbo.Buf, clientMajorVersion uint32, clientMinorVersion uint32) xturbo.Seq {
10	if b.Ext == nil {
11		b.Fail(xturbo.ErrExtMissing)
12		return 0
13	}
14	major := b.Ext.Major(xturbo.ExtRender)
15	if major == 0 {
16		b.Fail(xturbo.ErrExtMissing)
17		return 0
18	}
19	p, seq := b.Request(major, 0, 8)
20	if p == nil {
21		return 0
22	}
23	binary.LittleEndian.PutUint32(p[0:], uint32(clientMajorVersion))
24	binary.LittleEndian.PutUint32(p[4:], uint32(clientMinorVersion))
25	return seq
26}
27
28func QueryPictFormats(b *xturbo.Buf) xturbo.Seq {
29	if b.Ext == nil {
30		b.Fail(xturbo.ErrExtMissing)
31		return 0
32	}
33	major := b.Ext.Major(xturbo.ExtRender)
34	if major == 0 {
35		b.Fail(xturbo.ErrExtMissing)
36		return 0
37	}
38	p, seq := b.Request(major, 1, 0)
39	if p == nil {
40		return 0
41	}
42	return seq
43}
44
45func QueryPictIndexValues(b *xturbo.Buf, format Pictformat) xturbo.Seq {
46	if b.Ext == nil {
47		b.Fail(xturbo.ErrExtMissing)
48		return 0
49	}
50	major := b.Ext.Major(xturbo.ExtRender)
51	if major == 0 {
52		b.Fail(xturbo.ErrExtMissing)
53		return 0
54	}
55	p, seq := b.Request(major, 2, 4)
56	if p == nil {
57		return 0
58	}
59	binary.LittleEndian.PutUint32(p[0:], uint32(format))
60	return seq
61}
62
63type CreatePictureValues struct {
64	Mask             Cp
65	Repeat           Repeat
66	Alphamap         Picture
67	Alphaxorigin     int32
68	Alphayorigin     int32
69	Clipxorigin      int32
70	Clipyorigin      int32
71	Clipmask         xproto.Pixmap
72	Graphicsexposure uint32
73	Subwindowmode    xproto.SubwindowMode
74	Polyedge         PolyEdge
75	Polymode         PolyMode
76	Dither           xproto.Atom
77	Componentalpha   uint32
78}
79
80func (v *CreatePictureValues) SetRepeat(x Repeat) *CreatePictureValues {
81	v.Mask |= CpRepeat
82	v.Repeat = x
83	return v
84}
85func (v *CreatePictureValues) SetAlphamap(x Picture) *CreatePictureValues {
86	v.Mask |= CpAlphaMap
87	v.Alphamap = x
88	return v
89}
90func (v *CreatePictureValues) SetAlphaxorigin(x int32) *CreatePictureValues {
91	v.Mask |= CpAlphaXOrigin
92	v.Alphaxorigin = x
93	return v
94}
95func (v *CreatePictureValues) SetAlphayorigin(x int32) *CreatePictureValues {
96	v.Mask |= CpAlphaYOrigin
97	v.Alphayorigin = x
98	return v
99}
100func (v *CreatePictureValues) SetClipxorigin(x int32) *CreatePictureValues {
101	v.Mask |= CpClipXOrigin
102	v.Clipxorigin = x
103	return v
104}
105func (v *CreatePictureValues) SetClipyorigin(x int32) *CreatePictureValues {
106	v.Mask |= CpClipYOrigin
107	v.Clipyorigin = x
108	return v
109}
110func (v *CreatePictureValues) SetClipmask(x xproto.Pixmap) *CreatePictureValues {
111	v.Mask |= CpClipMask
112	v.Clipmask = x
113	return v
114}
115func (v *CreatePictureValues) SetGraphicsexposure(x uint32) *CreatePictureValues {
116	v.Mask |= CpGraphicsExposure
117	v.Graphicsexposure = x
118	return v
119}
120func (v *CreatePictureValues) SetSubwindowmode(x xproto.SubwindowMode) *CreatePictureValues {
121	v.Mask |= CpSubwindowMode
122	v.Subwindowmode = x
123	return v
124}
125func (v *CreatePictureValues) SetPolyedge(x PolyEdge) *CreatePictureValues {
126	v.Mask |= CpPolyEdge
127	v.Polyedge = x
128	return v
129}
130func (v *CreatePictureValues) SetPolymode(x PolyMode) *CreatePictureValues {
131	v.Mask |= CpPolyMode
132	v.Polymode = x
133	return v
134}
135func (v *CreatePictureValues) SetDither(x xproto.Atom) *CreatePictureValues {
136	v.Mask |= CpDither
137	v.Dither = x
138	return v
139}
140func (v *CreatePictureValues) SetComponentalpha(x uint32) *CreatePictureValues {
141	v.Mask |= CpComponentAlpha
142	v.Componentalpha = x
143	return v
144}
145func CreatePicture(b *xturbo.Buf, pid Picture, drawable xproto.Drawable, format Pictformat, v *CreatePictureValues) xturbo.Seq {
146	if b.Ext == nil {
147		b.Fail(xturbo.ErrExtMissing)
148		return 0
149	}
150	major := b.Ext.Major(xturbo.ExtRender)
151	if major == 0 {
152		b.Fail(xturbo.ErrExtMissing)
153		return 0
154	}
155	p, seq := b.Request(major, 4, 16+4*bits.OnesCount32(uint32(v.Mask)))
156	if p == nil {
157		return 0
158	}
159	binary.LittleEndian.PutUint32(p[0:], uint32(pid))
160	binary.LittleEndian.PutUint32(p[4:], uint32(drawable))
161	binary.LittleEndian.PutUint32(p[8:], uint32(format))
162	binary.LittleEndian.PutUint32(p[12:], uint32(v.Mask))
163	off := 16
164	if v.Mask&CpRepeat != 0 {
165		binary.LittleEndian.PutUint32(p[off:], uint32(v.Repeat))
166		off += 4
167	}
168	if v.Mask&CpAlphaMap != 0 {
169		binary.LittleEndian.PutUint32(p[off:], uint32(v.Alphamap))
170		off += 4
171	}
172	if v.Mask&CpAlphaXOrigin != 0 {
173		binary.LittleEndian.PutUint32(p[off:], uint32(v.Alphaxorigin))
174		off += 4
175	}
176	if v.Mask&CpAlphaYOrigin != 0 {
177		binary.LittleEndian.PutUint32(p[off:], uint32(v.Alphayorigin))
178		off += 4
179	}
180	if v.Mask&CpClipXOrigin != 0 {
181		binary.LittleEndian.PutUint32(p[off:], uint32(v.Clipxorigin))
182		off += 4
183	}
184	if v.Mask&CpClipYOrigin != 0 {
185		binary.LittleEndian.PutUint32(p[off:], uint32(v.Clipyorigin))
186		off += 4
187	}
188	if v.Mask&CpClipMask != 0 {
189		binary.LittleEndian.PutUint32(p[off:], uint32(v.Clipmask))
190		off += 4
191	}
192	if v.Mask&CpGraphicsExposure != 0 {
193		binary.LittleEndian.PutUint32(p[off:], uint32(v.Graphicsexposure))
194		off += 4
195	}
196	if v.Mask&CpSubwindowMode != 0 {
197		binary.LittleEndian.PutUint32(p[off:], uint32(v.Subwindowmode))
198		off += 4
199	}
200	if v.Mask&CpPolyEdge != 0 {
201		binary.LittleEndian.PutUint32(p[off:], uint32(v.Polyedge))
202		off += 4
203	}
204	if v.Mask&CpPolyMode != 0 {
205		binary.LittleEndian.PutUint32(p[off:], uint32(v.Polymode))
206		off += 4
207	}
208	if v.Mask&CpDither != 0 {
209		binary.LittleEndian.PutUint32(p[off:], uint32(v.Dither))
210		off += 4
211	}
212	if v.Mask&CpComponentAlpha != 0 {
213		binary.LittleEndian.PutUint32(p[off:], uint32(v.Componentalpha))
214		off += 4
215	}
216	_ = off
217	return seq
218}
219
220type ChangePictureValues struct {
221	Mask             Cp
222	Repeat           Repeat
223	Alphamap         Picture
224	Alphaxorigin     int32
225	Alphayorigin     int32
226	Clipxorigin      int32
227	Clipyorigin      int32
228	Clipmask         xproto.Pixmap
229	Graphicsexposure uint32
230	Subwindowmode    xproto.SubwindowMode
231	Polyedge         PolyEdge
232	Polymode         PolyMode
233	Dither           xproto.Atom
234	Componentalpha   uint32
235}
236
237func (v *ChangePictureValues) SetRepeat(x Repeat) *ChangePictureValues {
238	v.Mask |= CpRepeat
239	v.Repeat = x
240	return v
241}
242func (v *ChangePictureValues) SetAlphamap(x Picture) *ChangePictureValues {
243	v.Mask |= CpAlphaMap
244	v.Alphamap = x
245	return v
246}
247func (v *ChangePictureValues) SetAlphaxorigin(x int32) *ChangePictureValues {
248	v.Mask |= CpAlphaXOrigin
249	v.Alphaxorigin = x
250	return v
251}
252func (v *ChangePictureValues) SetAlphayorigin(x int32) *ChangePictureValues {
253	v.Mask |= CpAlphaYOrigin
254	v.Alphayorigin = x
255	return v
256}
257func (v *ChangePictureValues) SetClipxorigin(x int32) *ChangePictureValues {
258	v.Mask |= CpClipXOrigin
259	v.Clipxorigin = x
260	return v
261}
262func (v *ChangePictureValues) SetClipyorigin(x int32) *ChangePictureValues {
263	v.Mask |= CpClipYOrigin
264	v.Clipyorigin = x
265	return v
266}
267func (v *ChangePictureValues) SetClipmask(x xproto.Pixmap) *ChangePictureValues {
268	v.Mask |= CpClipMask
269	v.Clipmask = x
270	return v
271}
272func (v *ChangePictureValues) SetGraphicsexposure(x uint32) *ChangePictureValues {
273	v.Mask |= CpGraphicsExposure
274	v.Graphicsexposure = x
275	return v
276}
277func (v *ChangePictureValues) SetSubwindowmode(x xproto.SubwindowMode) *ChangePictureValues {
278	v.Mask |= CpSubwindowMode
279	v.Subwindowmode = x
280	return v
281}
282func (v *ChangePictureValues) SetPolyedge(x PolyEdge) *ChangePictureValues {
283	v.Mask |= CpPolyEdge
284	v.Polyedge = x
285	return v
286}
287func (v *ChangePictureValues) SetPolymode(x PolyMode) *ChangePictureValues {
288	v.Mask |= CpPolyMode
289	v.Polymode = x
290	return v
291}
292func (v *ChangePictureValues) SetDither(x xproto.Atom) *ChangePictureValues {
293	v.Mask |= CpDither
294	v.Dither = x
295	return v
296}
297func (v *ChangePictureValues) SetComponentalpha(x uint32) *ChangePictureValues {
298	v.Mask |= CpComponentAlpha
299	v.Componentalpha = x
300	return v
301}
302func ChangePicture(b *xturbo.Buf, picture Picture, v *ChangePictureValues) xturbo.Seq {
303	if b.Ext == nil {
304		b.Fail(xturbo.ErrExtMissing)
305		return 0
306	}
307	major := b.Ext.Major(xturbo.ExtRender)
308	if major == 0 {
309		b.Fail(xturbo.ErrExtMissing)
310		return 0
311	}
312	p, seq := b.Request(major, 5, 8+4*bits.OnesCount32(uint32(v.Mask)))
313	if p == nil {
314		return 0
315	}
316	binary.LittleEndian.PutUint32(p[0:], uint32(picture))
317	binary.LittleEndian.PutUint32(p[4:], uint32(v.Mask))
318	off := 8
319	if v.Mask&CpRepeat != 0 {
320		binary.LittleEndian.PutUint32(p[off:], uint32(v.Repeat))
321		off += 4
322	}
323	if v.Mask&CpAlphaMap != 0 {
324		binary.LittleEndian.PutUint32(p[off:], uint32(v.Alphamap))
325		off += 4
326	}
327	if v.Mask&CpAlphaXOrigin != 0 {
328		binary.LittleEndian.PutUint32(p[off:], uint32(v.Alphaxorigin))
329		off += 4
330	}
331	if v.Mask&CpAlphaYOrigin != 0 {
332		binary.LittleEndian.PutUint32(p[off:], uint32(v.Alphayorigin))
333		off += 4
334	}
335	if v.Mask&CpClipXOrigin != 0 {
336		binary.LittleEndian.PutUint32(p[off:], uint32(v.Clipxorigin))
337		off += 4
338	}
339	if v.Mask&CpClipYOrigin != 0 {
340		binary.LittleEndian.PutUint32(p[off:], uint32(v.Clipyorigin))
341		off += 4
342	}
343	if v.Mask&CpClipMask != 0 {
344		binary.LittleEndian.PutUint32(p[off:], uint32(v.Clipmask))
345		off += 4
346	}
347	if v.Mask&CpGraphicsExposure != 0 {
348		binary.LittleEndian.PutUint32(p[off:], uint32(v.Graphicsexposure))
349		off += 4
350	}
351	if v.Mask&CpSubwindowMode != 0 {
352		binary.LittleEndian.PutUint32(p[off:], uint32(v.Subwindowmode))
353		off += 4
354	}
355	if v.Mask&CpPolyEdge != 0 {
356		binary.LittleEndian.PutUint32(p[off:], uint32(v.Polyedge))
357		off += 4
358	}
359	if v.Mask&CpPolyMode != 0 {
360		binary.LittleEndian.PutUint32(p[off:], uint32(v.Polymode))
361		off += 4
362	}
363	if v.Mask&CpDither != 0 {
364		binary.LittleEndian.PutUint32(p[off:], uint32(v.Dither))
365		off += 4
366	}
367	if v.Mask&CpComponentAlpha != 0 {
368		binary.LittleEndian.PutUint32(p[off:], uint32(v.Componentalpha))
369		off += 4
370	}
371	_ = off
372	return seq
373}
374
375func SetPictureClipRectangles(b *xturbo.Buf, picture Picture, clipXOrigin int16, clipYOrigin int16, rectangles []xproto.Rectangle) xturbo.Seq {
376	size := 0
377	size += 4
378	size += 2
379	size += 2
380	size += len(rectangles) * 8
381	size = (size + 3) &^ 3
382	if b.Ext == nil {
383		b.Fail(xturbo.ErrExtMissing)
384		return 0
385	}
386	major := b.Ext.Major(xturbo.ExtRender)
387	if major == 0 {
388		b.Fail(xturbo.ErrExtMissing)
389		return 0
390	}
391	p, seq := b.Request(major, 6, size)
392	if p == nil {
393		return 0
394	}
395	off := 0
396	binary.LittleEndian.PutUint32(p[off:], uint32(picture))
397	off += 4
398	binary.LittleEndian.PutUint16(p[off:], uint16(clipXOrigin))
399	off += 2
400	binary.LittleEndian.PutUint16(p[off:], uint16(clipYOrigin))
401	off += 2
402	for i := range rectangles {
403		rectangles[i].Put(p[off:])
404		off += 8
405	}
406	return seq
407}
408
409func FreePicture(b *xturbo.Buf, picture Picture) xturbo.Seq {
410	if b.Ext == nil {
411		b.Fail(xturbo.ErrExtMissing)
412		return 0
413	}
414	major := b.Ext.Major(xturbo.ExtRender)
415	if major == 0 {
416		b.Fail(xturbo.ErrExtMissing)
417		return 0
418	}
419	p, seq := b.Request(major, 7, 4)
420	if p == nil {
421		return 0
422	}
423	binary.LittleEndian.PutUint32(p[0:], uint32(picture))
424	return seq
425}
426
427func Composite(b *xturbo.Buf, op PictOp, src Picture, mask Picture, dst Picture, srcX int16, srcY int16, maskX int16, maskY int16, dstX int16, dstY int16, width uint16, height uint16) xturbo.Seq {
428	if b.Ext == nil {
429		b.Fail(xturbo.ErrExtMissing)
430		return 0
431	}
432	major := b.Ext.Major(xturbo.ExtRender)
433	if major == 0 {
434		b.Fail(xturbo.ErrExtMissing)
435		return 0
436	}
437	p, seq := b.Request(major, 8, 32)
438	if p == nil {
439		return 0
440	}
441	p[0:][0] = byte(op)
442	binary.LittleEndian.PutUint32(p[4:], uint32(src))
443	binary.LittleEndian.PutUint32(p[8:], uint32(mask))
444	binary.LittleEndian.PutUint32(p[12:], uint32(dst))
445	binary.LittleEndian.PutUint16(p[16:], uint16(srcX))
446	binary.LittleEndian.PutUint16(p[18:], uint16(srcY))
447	binary.LittleEndian.PutUint16(p[20:], uint16(maskX))
448	binary.LittleEndian.PutUint16(p[22:], uint16(maskY))
449	binary.LittleEndian.PutUint16(p[24:], uint16(dstX))
450	binary.LittleEndian.PutUint16(p[26:], uint16(dstY))
451	binary.LittleEndian.PutUint16(p[28:], uint16(width))
452	binary.LittleEndian.PutUint16(p[30:], uint16(height))
453	return seq
454}
455
456func Trapezoids(b *xturbo.Buf, op PictOp, src Picture, dst Picture, maskFormat Pictformat, srcX int16, srcY int16, traps []Trapezoid) xturbo.Seq {
457	size := 0
458	size += 1
459	size += 3
460	size += 4
461	size += 4
462	size += 4
463	size += 2
464	size += 2
465	size += len(traps) * 40
466	size = (size + 3) &^ 3
467	if b.Ext == nil {
468		b.Fail(xturbo.ErrExtMissing)
469		return 0
470	}
471	major := b.Ext.Major(xturbo.ExtRender)
472	if major == 0 {
473		b.Fail(xturbo.ErrExtMissing)
474		return 0
475	}
476	p, seq := b.Request(major, 10, size)
477	if p == nil {
478		return 0
479	}
480	off := 0
481	p[off:][0] = byte(op)
482	off += 1
483	off += 3
484	binary.LittleEndian.PutUint32(p[off:], uint32(src))
485	off += 4
486	binary.LittleEndian.PutUint32(p[off:], uint32(dst))
487	off += 4
488	binary.LittleEndian.PutUint32(p[off:], uint32(maskFormat))
489	off += 4
490	binary.LittleEndian.PutUint16(p[off:], uint16(srcX))
491	off += 2
492	binary.LittleEndian.PutUint16(p[off:], uint16(srcY))
493	off += 2
494	for i := range traps {
495		traps[i].Put(p[off:])
496		off += 40
497	}
498	return seq
499}
500
501func Triangles(b *xturbo.Buf, op PictOp, src Picture, dst Picture, maskFormat Pictformat, srcX int16, srcY int16, triangles []Triangle) xturbo.Seq {
502	size := 0
503	size += 1
504	size += 3
505	size += 4
506	size += 4
507	size += 4
508	size += 2
509	size += 2
510	size += len(triangles) * 24
511	size = (size + 3) &^ 3
512	if b.Ext == nil {
513		b.Fail(xturbo.ErrExtMissing)
514		return 0
515	}
516	major := b.Ext.Major(xturbo.ExtRender)
517	if major == 0 {
518		b.Fail(xturbo.ErrExtMissing)
519		return 0
520	}
521	p, seq := b.Request(major, 11, size)
522	if p == nil {
523		return 0
524	}
525	off := 0
526	p[off:][0] = byte(op)
527	off += 1
528	off += 3
529	binary.LittleEndian.PutUint32(p[off:], uint32(src))
530	off += 4
531	binary.LittleEndian.PutUint32(p[off:], uint32(dst))
532	off += 4
533	binary.LittleEndian.PutUint32(p[off:], uint32(maskFormat))
534	off += 4
535	binary.LittleEndian.PutUint16(p[off:], uint16(srcX))
536	off += 2
537	binary.LittleEndian.PutUint16(p[off:], uint16(srcY))
538	off += 2
539	for i := range triangles {
540		triangles[i].Put(p[off:])
541		off += 24
542	}
543	return seq
544}
545
546func TriStrip(b *xturbo.Buf, op PictOp, src Picture, dst Picture, maskFormat Pictformat, srcX int16, srcY int16, points []Pointfix) xturbo.Seq {
547	size := 0
548	size += 1
549	size += 3
550	size += 4
551	size += 4
552	size += 4
553	size += 2
554	size += 2
555	size += len(points) * 8
556	size = (size + 3) &^ 3
557	if b.Ext == nil {
558		b.Fail(xturbo.ErrExtMissing)
559		return 0
560	}
561	major := b.Ext.Major(xturbo.ExtRender)
562	if major == 0 {
563		b.Fail(xturbo.ErrExtMissing)
564		return 0
565	}
566	p, seq := b.Request(major, 12, size)
567	if p == nil {
568		return 0
569	}
570	off := 0
571	p[off:][0] = byte(op)
572	off += 1
573	off += 3
574	binary.LittleEndian.PutUint32(p[off:], uint32(src))
575	off += 4
576	binary.LittleEndian.PutUint32(p[off:], uint32(dst))
577	off += 4
578	binary.LittleEndian.PutUint32(p[off:], uint32(maskFormat))
579	off += 4
580	binary.LittleEndian.PutUint16(p[off:], uint16(srcX))
581	off += 2
582	binary.LittleEndian.PutUint16(p[off:], uint16(srcY))
583	off += 2
584	for i := range points {
585		points[i].Put(p[off:])
586		off += 8
587	}
588	return seq
589}
590
591func TriFan(b *xturbo.Buf, op PictOp, src Picture, dst Picture, maskFormat Pictformat, srcX int16, srcY int16, points []Pointfix) xturbo.Seq {
592	size := 0
593	size += 1
594	size += 3
595	size += 4
596	size += 4
597	size += 4
598	size += 2
599	size += 2
600	size += len(points) * 8
601	size = (size + 3) &^ 3
602	if b.Ext == nil {
603		b.Fail(xturbo.ErrExtMissing)
604		return 0
605	}
606	major := b.Ext.Major(xturbo.ExtRender)
607	if major == 0 {
608		b.Fail(xturbo.ErrExtMissing)
609		return 0
610	}
611	p, seq := b.Request(major, 13, size)
612	if p == nil {
613		return 0
614	}
615	off := 0
616	p[off:][0] = byte(op)
617	off += 1
618	off += 3
619	binary.LittleEndian.PutUint32(p[off:], uint32(src))
620	off += 4
621	binary.LittleEndian.PutUint32(p[off:], uint32(dst))
622	off += 4
623	binary.LittleEndian.PutUint32(p[off:], uint32(maskFormat))
624	off += 4
625	binary.LittleEndian.PutUint16(p[off:], uint16(srcX))
626	off += 2
627	binary.LittleEndian.PutUint16(p[off:], uint16(srcY))
628	off += 2
629	for i := range points {
630		points[i].Put(p[off:])
631		off += 8
632	}
633	return seq
634}
635
636func CreateGlyphSet(b *xturbo.Buf, gsid Glyphset, format Pictformat) xturbo.Seq {
637	if b.Ext == nil {
638		b.Fail(xturbo.ErrExtMissing)
639		return 0
640	}
641	major := b.Ext.Major(xturbo.ExtRender)
642	if major == 0 {
643		b.Fail(xturbo.ErrExtMissing)
644		return 0
645	}
646	p, seq := b.Request(major, 17, 8)
647	if p == nil {
648		return 0
649	}
650	binary.LittleEndian.PutUint32(p[0:], uint32(gsid))
651	binary.LittleEndian.PutUint32(p[4:], uint32(format))
652	return seq
653}
654
655func ReferenceGlyphSet(b *xturbo.Buf, gsid Glyphset, existing Glyphset) xturbo.Seq {
656	if b.Ext == nil {
657		b.Fail(xturbo.ErrExtMissing)
658		return 0
659	}
660	major := b.Ext.Major(xturbo.ExtRender)
661	if major == 0 {
662		b.Fail(xturbo.ErrExtMissing)
663		return 0
664	}
665	p, seq := b.Request(major, 18, 8)
666	if p == nil {
667		return 0
668	}
669	binary.LittleEndian.PutUint32(p[0:], uint32(gsid))
670	binary.LittleEndian.PutUint32(p[4:], uint32(existing))
671	return seq
672}
673
674func FreeGlyphSet(b *xturbo.Buf, glyphset Glyphset) xturbo.Seq {
675	if b.Ext == nil {
676		b.Fail(xturbo.ErrExtMissing)
677		return 0
678	}
679	major := b.Ext.Major(xturbo.ExtRender)
680	if major == 0 {
681		b.Fail(xturbo.ErrExtMissing)
682		return 0
683	}
684	p, seq := b.Request(major, 19, 4)
685	if p == nil {
686		return 0
687	}
688	binary.LittleEndian.PutUint32(p[0:], uint32(glyphset))
689	return seq
690}
691
692func AddGlyphs(b *xturbo.Buf, glyphset Glyphset, glyphsLen uint32, glyphids []uint32, glyphs []Glyphinfo, data []byte) xturbo.Seq {
693	if len(glyphids) != int(glyphsLen) {
694		b.Fail(xturbo.ErrBadLength)
695		return 0
696	}
697	if len(glyphs) != int(glyphsLen) {
698		b.Fail(xturbo.ErrBadLength)
699		return 0
700	}
701	size := 0
702	size += 4
703	size += 4
704	size += len(glyphids) * 4
705	size += len(glyphs) * 12
706	size += len(data) * 1
707	size = (size + 3) &^ 3
708	if b.Ext == nil {
709		b.Fail(xturbo.ErrExtMissing)
710		return 0
711	}
712	major := b.Ext.Major(xturbo.ExtRender)
713	if major == 0 {
714		b.Fail(xturbo.ErrExtMissing)
715		return 0
716	}
717	p, seq := b.Request(major, 20, size)
718	if p == nil {
719		return 0
720	}
721	off := 0
722	binary.LittleEndian.PutUint32(p[off:], uint32(glyphset))
723	off += 4
724	binary.LittleEndian.PutUint32(p[off:], uint32(glyphsLen))
725	off += 4
726	for i := range glyphids {
727		binary.LittleEndian.PutUint32(p[off:], uint32(glyphids[i]))
728		off += 4
729	}
730	for i := range glyphs {
731		glyphs[i].Put(p[off:])
732		off += 12
733	}
734	copy(p[off:], data)
735	off += len(data)
736	return seq
737}
738
739func FreeGlyphs(b *xturbo.Buf, glyphset Glyphset, glyphs []Glyph) xturbo.Seq {
740	size := 0
741	size += 4
742	size += len(glyphs) * 4
743	size = (size + 3) &^ 3
744	if b.Ext == nil {
745		b.Fail(xturbo.ErrExtMissing)
746		return 0
747	}
748	major := b.Ext.Major(xturbo.ExtRender)
749	if major == 0 {
750		b.Fail(xturbo.ErrExtMissing)
751		return 0
752	}
753	p, seq := b.Request(major, 22, size)
754	if p == nil {
755		return 0
756	}
757	off := 0
758	binary.LittleEndian.PutUint32(p[off:], uint32(glyphset))
759	off += 4
760	for i := range glyphs {
761		binary.LittleEndian.PutUint32(p[off:], uint32(glyphs[i]))
762		off += 4
763	}
764	return seq
765}
766
767func CompositeGlyphs8(b *xturbo.Buf, op PictOp, src Picture, dst Picture, maskFormat Pictformat, glyphset Glyphset, srcX int16, srcY int16, glyphcmds []byte) xturbo.Seq {
768	size := 0
769	size += 1
770	size += 3
771	size += 4
772	size += 4
773	size += 4
774	size += 4
775	size += 2
776	size += 2
777	size += len(glyphcmds) * 1
778	size = (size + 3) &^ 3
779	if b.Ext == nil {
780		b.Fail(xturbo.ErrExtMissing)
781		return 0
782	}
783	major := b.Ext.Major(xturbo.ExtRender)
784	if major == 0 {
785		b.Fail(xturbo.ErrExtMissing)
786		return 0
787	}
788	p, seq := b.Request(major, 23, size)
789	if p == nil {
790		return 0
791	}
792	off := 0
793	p[off:][0] = byte(op)
794	off += 1
795	off += 3
796	binary.LittleEndian.PutUint32(p[off:], uint32(src))
797	off += 4
798	binary.LittleEndian.PutUint32(p[off:], uint32(dst))
799	off += 4
800	binary.LittleEndian.PutUint32(p[off:], uint32(maskFormat))
801	off += 4
802	binary.LittleEndian.PutUint32(p[off:], uint32(glyphset))
803	off += 4
804	binary.LittleEndian.PutUint16(p[off:], uint16(srcX))
805	off += 2
806	binary.LittleEndian.PutUint16(p[off:], uint16(srcY))
807	off += 2
808	copy(p[off:], glyphcmds)
809	off += len(glyphcmds)
810	return seq
811}
812
813func CompositeGlyphs16(b *xturbo.Buf, op PictOp, src Picture, dst Picture, maskFormat Pictformat, glyphset Glyphset, srcX int16, srcY int16, glyphcmds []byte) xturbo.Seq {
814	size := 0
815	size += 1
816	size += 3
817	size += 4
818	size += 4
819	size += 4
820	size += 4
821	size += 2
822	size += 2
823	size += len(glyphcmds) * 1
824	size = (size + 3) &^ 3
825	if b.Ext == nil {
826		b.Fail(xturbo.ErrExtMissing)
827		return 0
828	}
829	major := b.Ext.Major(xturbo.ExtRender)
830	if major == 0 {
831		b.Fail(xturbo.ErrExtMissing)
832		return 0
833	}
834	p, seq := b.Request(major, 24, size)
835	if p == nil {
836		return 0
837	}
838	off := 0
839	p[off:][0] = byte(op)
840	off += 1
841	off += 3
842	binary.LittleEndian.PutUint32(p[off:], uint32(src))
843	off += 4
844	binary.LittleEndian.PutUint32(p[off:], uint32(dst))
845	off += 4
846	binary.LittleEndian.PutUint32(p[off:], uint32(maskFormat))
847	off += 4
848	binary.LittleEndian.PutUint32(p[off:], uint32(glyphset))
849	off += 4
850	binary.LittleEndian.PutUint16(p[off:], uint16(srcX))
851	off += 2
852	binary.LittleEndian.PutUint16(p[off:], uint16(srcY))
853	off += 2
854	copy(p[off:], glyphcmds)
855	off += len(glyphcmds)
856	return seq
857}
858
859func CompositeGlyphs32(b *xturbo.Buf, op PictOp, src Picture, dst Picture, maskFormat Pictformat, glyphset Glyphset, srcX int16, srcY int16, glyphcmds []byte) xturbo.Seq {
860	size := 0
861	size += 1
862	size += 3
863	size += 4
864	size += 4
865	size += 4
866	size += 4
867	size += 2
868	size += 2
869	size += len(glyphcmds) * 1
870	size = (size + 3) &^ 3
871	if b.Ext == nil {
872		b.Fail(xturbo.ErrExtMissing)
873		return 0
874	}
875	major := b.Ext.Major(xturbo.ExtRender)
876	if major == 0 {
877		b.Fail(xturbo.ErrExtMissing)
878		return 0
879	}
880	p, seq := b.Request(major, 25, size)
881	if p == nil {
882		return 0
883	}
884	off := 0
885	p[off:][0] = byte(op)
886	off += 1
887	off += 3
888	binary.LittleEndian.PutUint32(p[off:], uint32(src))
889	off += 4
890	binary.LittleEndian.PutUint32(p[off:], uint32(dst))
891	off += 4
892	binary.LittleEndian.PutUint32(p[off:], uint32(maskFormat))
893	off += 4
894	binary.LittleEndian.PutUint32(p[off:], uint32(glyphset))
895	off += 4
896	binary.LittleEndian.PutUint16(p[off:], uint16(srcX))
897	off += 2
898	binary.LittleEndian.PutUint16(p[off:], uint16(srcY))
899	off += 2
900	copy(p[off:], glyphcmds)
901	off += len(glyphcmds)
902	return seq
903}
904
905func FillRectangles(b *xturbo.Buf, op PictOp, dst Picture, color Color, rects []xproto.Rectangle) xturbo.Seq {
906	size := 0
907	size += 1
908	size += 3
909	size += 4
910	size += 8
911	size += len(rects) * 8
912	size = (size + 3) &^ 3
913	if b.Ext == nil {
914		b.Fail(xturbo.ErrExtMissing)
915		return 0
916	}
917	major := b.Ext.Major(xturbo.ExtRender)
918	if major == 0 {
919		b.Fail(xturbo.ErrExtMissing)
920		return 0
921	}
922	p, seq := b.Request(major, 26, size)
923	if p == nil {
924		return 0
925	}
926	off := 0
927	p[off:][0] = byte(op)
928	off += 1
929	off += 3
930	binary.LittleEndian.PutUint32(p[off:], uint32(dst))
931	off += 4
932	color.Put(p[off:])
933	off += 8
934	for i := range rects {
935		rects[i].Put(p[off:])
936		off += 8
937	}
938	return seq
939}
940
941func CreateCursor(b *xturbo.Buf, cid xproto.Cursor, source Picture, x uint16, y uint16) xturbo.Seq {
942	if b.Ext == nil {
943		b.Fail(xturbo.ErrExtMissing)
944		return 0
945	}
946	major := b.Ext.Major(xturbo.ExtRender)
947	if major == 0 {
948		b.Fail(xturbo.ErrExtMissing)
949		return 0
950	}
951	p, seq := b.Request(major, 27, 12)
952	if p == nil {
953		return 0
954	}
955	binary.LittleEndian.PutUint32(p[0:], uint32(cid))
956	binary.LittleEndian.PutUint32(p[4:], uint32(source))
957	binary.LittleEndian.PutUint16(p[8:], uint16(x))
958	binary.LittleEndian.PutUint16(p[10:], uint16(y))
959	return seq
960}
961
962func SetPictureTransform(b *xturbo.Buf, picture Picture, transform Transform) xturbo.Seq {
963	if b.Ext == nil {
964		b.Fail(xturbo.ErrExtMissing)
965		return 0
966	}
967	major := b.Ext.Major(xturbo.ExtRender)
968	if major == 0 {
969		b.Fail(xturbo.ErrExtMissing)
970		return 0
971	}
972	p, seq := b.Request(major, 28, 40)
973	if p == nil {
974		return 0
975	}
976	binary.LittleEndian.PutUint32(p[0:], uint32(picture))
977	transform.Put(p[4:])
978	return seq
979}
980
981func QueryFilters(b *xturbo.Buf, drawable xproto.Drawable) xturbo.Seq {
982	if b.Ext == nil {
983		b.Fail(xturbo.ErrExtMissing)
984		return 0
985	}
986	major := b.Ext.Major(xturbo.ExtRender)
987	if major == 0 {
988		b.Fail(xturbo.ErrExtMissing)
989		return 0
990	}
991	p, seq := b.Request(major, 29, 4)
992	if p == nil {
993		return 0
994	}
995	binary.LittleEndian.PutUint32(p[0:], uint32(drawable))
996	return seq
997}
998
999func SetPictureFilter(b *xturbo.Buf, picture Picture, filter string, values []Fixed) xturbo.Seq {
1000	if uint64(len(filter)) > 65535 {
1001		b.Fail(xturbo.ErrBadLength)
1002		return 0
1003	}
1004	size := 0
1005	size += 4
1006	size += 2
1007	size += 2
1008	size += len(filter) * 1
1009	size = (size + 3) &^ 3
1010	size += len(values) * 4
1011	size = (size + 3) &^ 3
1012	if b.Ext == nil {
1013		b.Fail(xturbo.ErrExtMissing)
1014		return 0
1015	}
1016	major := b.Ext.Major(xturbo.ExtRender)
1017	if major == 0 {
1018		b.Fail(xturbo.ErrExtMissing)
1019		return 0
1020	}
1021	p, seq := b.Request(major, 30, size)
1022	if p == nil {
1023		return 0
1024	}
1025	off := 0
1026	binary.LittleEndian.PutUint32(p[off:], uint32(picture))
1027	off += 4
1028	binary.LittleEndian.PutUint16(p[off:], uint16(len(filter)))
1029	off += 2
1030	off += 2
1031	copy(p[off:], filter)
1032	off += len(filter)
1033	off = (off + 3) &^ 3
1034	for i := range values {
1035		binary.LittleEndian.PutUint32(p[off:], uint32(values[i]))
1036		off += 4
1037	}
1038	return seq
1039}
1040
1041func CreateAnimCursor(b *xturbo.Buf, cid xproto.Cursor, cursors []Animcursorelt) xturbo.Seq {
1042	size := 0
1043	size += 4
1044	size += len(cursors) * 8
1045	size = (size + 3) &^ 3
1046	if b.Ext == nil {
1047		b.Fail(xturbo.ErrExtMissing)
1048		return 0
1049	}
1050	major := b.Ext.Major(xturbo.ExtRender)
1051	if major == 0 {
1052		b.Fail(xturbo.ErrExtMissing)
1053		return 0
1054	}
1055	p, seq := b.Request(major, 31, size)
1056	if p == nil {
1057		return 0
1058	}
1059	off := 0
1060	binary.LittleEndian.PutUint32(p[off:], uint32(cid))
1061	off += 4
1062	for i := range cursors {
1063		cursors[i].Put(p[off:])
1064		off += 8
1065	}
1066	return seq
1067}
1068
1069func AddTraps(b *xturbo.Buf, picture Picture, xOff int16, yOff int16, traps []Trap) xturbo.Seq {
1070	size := 0
1071	size += 4
1072	size += 2
1073	size += 2
1074	size += len(traps) * 24
1075	size = (size + 3) &^ 3
1076	if b.Ext == nil {
1077		b.Fail(xturbo.ErrExtMissing)
1078		return 0
1079	}
1080	major := b.Ext.Major(xturbo.ExtRender)
1081	if major == 0 {
1082		b.Fail(xturbo.ErrExtMissing)
1083		return 0
1084	}
1085	p, seq := b.Request(major, 32, size)
1086	if p == nil {
1087		return 0
1088	}
1089	off := 0
1090	binary.LittleEndian.PutUint32(p[off:], uint32(picture))
1091	off += 4
1092	binary.LittleEndian.PutUint16(p[off:], uint16(xOff))
1093	off += 2
1094	binary.LittleEndian.PutUint16(p[off:], uint16(yOff))
1095	off += 2
1096	for i := range traps {
1097		traps[i].Put(p[off:])
1098		off += 24
1099	}
1100	return seq
1101}
1102
1103func CreateSolidFill(b *xturbo.Buf, picture Picture, color Color) xturbo.Seq {
1104	if b.Ext == nil {
1105		b.Fail(xturbo.ErrExtMissing)
1106		return 0
1107	}
1108	major := b.Ext.Major(xturbo.ExtRender)
1109	if major == 0 {
1110		b.Fail(xturbo.ErrExtMissing)
1111		return 0
1112	}
1113	p, seq := b.Request(major, 33, 12)
1114	if p == nil {
1115		return 0
1116	}
1117	binary.LittleEndian.PutUint32(p[0:], uint32(picture))
1118	color.Put(p[4:])
1119	return seq
1120}
1121
1122func CreateLinearGradient(b *xturbo.Buf, picture Picture, p1 Pointfix, p2 Pointfix, numStops uint32, stops []Fixed, colors []Color) xturbo.Seq {
1123	if len(stops) != int(numStops) {
1124		b.Fail(xturbo.ErrBadLength)
1125		return 0
1126	}
1127	if len(colors) != int(numStops) {
1128		b.Fail(xturbo.ErrBadLength)
1129		return 0
1130	}
1131	size := 0
1132	size += 4
1133	size += 8
1134	size += 8
1135	size += 4
1136	size += len(stops) * 4
1137	size += len(colors) * 8
1138	size = (size + 3) &^ 3
1139	if b.Ext == nil {
1140		b.Fail(xturbo.ErrExtMissing)
1141		return 0
1142	}
1143	major := b.Ext.Major(xturbo.ExtRender)
1144	if major == 0 {
1145		b.Fail(xturbo.ErrExtMissing)
1146		return 0
1147	}
1148	p, seq := b.Request(major, 34, size)
1149	if p == nil {
1150		return 0
1151	}
1152	off := 0
1153	binary.LittleEndian.PutUint32(p[off:], uint32(picture))
1154	off += 4
1155	p1.Put(p[off:])
1156	off += 8
1157	p2.Put(p[off:])
1158	off += 8
1159	binary.LittleEndian.PutUint32(p[off:], uint32(numStops))
1160	off += 4
1161	for i := range stops {
1162		binary.LittleEndian.PutUint32(p[off:], uint32(stops[i]))
1163		off += 4
1164	}
1165	for i := range colors {
1166		colors[i].Put(p[off:])
1167		off += 8
1168	}
1169	return seq
1170}
1171
1172func CreateRadialGradient(b *xturbo.Buf, picture Picture, inner Pointfix, outer Pointfix, innerRadius Fixed, outerRadius Fixed, numStops uint32, stops []Fixed, colors []Color) xturbo.Seq {
1173	if len(stops) != int(numStops) {
1174		b.Fail(xturbo.ErrBadLength)
1175		return 0
1176	}
1177	if len(colors) != int(numStops) {
1178		b.Fail(xturbo.ErrBadLength)
1179		return 0
1180	}
1181	size := 0
1182	size += 4
1183	size += 8
1184	size += 8
1185	size += 4
1186	size += 4
1187	size += 4
1188	size += len(stops) * 4
1189	size += len(colors) * 8
1190	size = (size + 3) &^ 3
1191	if b.Ext == nil {
1192		b.Fail(xturbo.ErrExtMissing)
1193		return 0
1194	}
1195	major := b.Ext.Major(xturbo.ExtRender)
1196	if major == 0 {
1197		b.Fail(xturbo.ErrExtMissing)
1198		return 0
1199	}
1200	p, seq := b.Request(major, 35, size)
1201	if p == nil {
1202		return 0
1203	}
1204	off := 0
1205	binary.LittleEndian.PutUint32(p[off:], uint32(picture))
1206	off += 4
1207	inner.Put(p[off:])
1208	off += 8
1209	outer.Put(p[off:])
1210	off += 8
1211	binary.LittleEndian.PutUint32(p[off:], uint32(innerRadius))
1212	off += 4
1213	binary.LittleEndian.PutUint32(p[off:], uint32(outerRadius))
1214	off += 4
1215	binary.LittleEndian.PutUint32(p[off:], uint32(numStops))
1216	off += 4
1217	for i := range stops {
1218		binary.LittleEndian.PutUint32(p[off:], uint32(stops[i]))
1219		off += 4
1220	}
1221	for i := range colors {
1222		colors[i].Put(p[off:])
1223		off += 8
1224	}
1225	return seq
1226}
1227
1228func CreateConicalGradient(b *xturbo.Buf, picture Picture, center Pointfix, angle Fixed, numStops uint32, stops []Fixed, colors []Color) xturbo.Seq {
1229	if len(stops) != int(numStops) {
1230		b.Fail(xturbo.ErrBadLength)
1231		return 0
1232	}
1233	if len(colors) != int(numStops) {
1234		b.Fail(xturbo.ErrBadLength)
1235		return 0
1236	}
1237	size := 0
1238	size += 4
1239	size += 8
1240	size += 4
1241	size += 4
1242	size += len(stops) * 4
1243	size += len(colors) * 8
1244	size = (size + 3) &^ 3
1245	if b.Ext == nil {
1246		b.Fail(xturbo.ErrExtMissing)
1247		return 0
1248	}
1249	major := b.Ext.Major(xturbo.ExtRender)
1250	if major == 0 {
1251		b.Fail(xturbo.ErrExtMissing)
1252		return 0
1253	}
1254	p, seq := b.Request(major, 36, size)
1255	if p == nil {
1256		return 0
1257	}
1258	off := 0
1259	binary.LittleEndian.PutUint32(p[off:], uint32(picture))
1260	off += 4
1261	center.Put(p[off:])
1262	off += 8
1263	binary.LittleEndian.PutUint32(p[off:], uint32(angle))
1264	off += 4
1265	binary.LittleEndian.PutUint32(p[off:], uint32(numStops))
1266	off += 4
1267	for i := range stops {
1268		binary.LittleEndian.PutUint32(p[off:], uint32(stops[i]))
1269		off += 4
1270	}
1271	for i := range colors {
1272		colors[i].Put(p[off:])
1273		off += 8
1274	}
1275	return seq
1276}

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 1

↑↓ moveenter openesc close