Exemplo n.º 1
0
// BufferSwapCompleteEventNew constructs a BufferSwapCompleteEvent value that implements xgb.Event from a byte slice.
func BufferSwapCompleteEventNew(buf []byte) xgb.Event {
	v := BufferSwapCompleteEvent{}
	b := 1 // don't read event number

	b += 1 // padding

	v.Sequence = xgb.Get16(buf[b:])
	b += 2

	v.EventType = xgb.Get16(buf[b:])
	b += 2

	b += 2 // padding

	v.Drawable = xproto.Drawable(xgb.Get32(buf[b:]))
	b += 4

	v.UstHi = xgb.Get32(buf[b:])
	b += 4

	v.UstLo = xgb.Get32(buf[b:])
	b += 4

	v.MscHi = xgb.Get32(buf[b:])
	b += 4

	v.MscLo = xgb.Get32(buf[b:])
	b += 4

	v.Sbc = xgb.Get32(buf[b:])
	b += 4

	return v
}
Exemplo n.º 2
0
// CompletionEventNew constructs a CompletionEvent value that implements xgb.Event from a byte slice.
func CompletionEventNew(buf []byte) xgb.Event {
	v := CompletionEvent{}
	b := 1 // don't read event number

	b += 1 // padding

	v.Sequence = xgb.Get16(buf[b:])
	b += 2

	v.Drawable = xproto.Drawable(xgb.Get32(buf[b:]))
	b += 4

	v.MinorEvent = xgb.Get16(buf[b:])
	b += 2

	v.MajorEvent = buf[b]
	b += 1

	b += 1 // padding

	v.Shmseg = Seg(xgb.Get32(buf[b:]))
	b += 4

	v.Offset = xgb.Get32(buf[b:])
	b += 4

	return v
}
Exemplo n.º 3
0
// Range16Read reads a byte slice into a Range16 value.
func Range16Read(buf []byte, v *Range16) int {
	b := 0

	v.First = xgb.Get16(buf[b:])
	b += 2

	v.Last = xgb.Get16(buf[b:])
	b += 2

	return b
}
Exemplo n.º 4
0
// queryExtentsReply reads a byte slice into a QueryExtentsReply value.
func queryExtentsReply(buf []byte) *QueryExtentsReply {
	v := new(QueryExtentsReply)
	b := 1 // skip reply determinant

	b += 1 // padding

	v.Sequence = xgb.Get16(buf[b:])
	b += 2

	v.Length = xgb.Get32(buf[b:]) // 4-byte units
	b += 4

	if buf[b] == 1 {
		v.BoundingShaped = true
	} else {
		v.BoundingShaped = false
	}
	b += 1

	if buf[b] == 1 {
		v.ClipShaped = true
	} else {
		v.ClipShaped = false
	}
	b += 1

	b += 2 // padding

	v.BoundingShapeExtentsX = int16(xgb.Get16(buf[b:]))
	b += 2

	v.BoundingShapeExtentsY = int16(xgb.Get16(buf[b:]))
	b += 2

	v.BoundingShapeExtentsWidth = xgb.Get16(buf[b:])
	b += 2

	v.BoundingShapeExtentsHeight = xgb.Get16(buf[b:])
	b += 2

	v.ClipShapeExtentsX = int16(xgb.Get16(buf[b:]))
	b += 2

	v.ClipShapeExtentsY = int16(xgb.Get16(buf[b:]))
	b += 2

	v.ClipShapeExtentsWidth = xgb.Get16(buf[b:])
	b += 2

	v.ClipShapeExtentsHeight = xgb.Get16(buf[b:])
	b += 2

	return v
}
Exemplo n.º 5
0
// getContextReply reads a byte slice into a GetContextReply value.
func getContextReply(buf []byte) *GetContextReply {
	v := new(GetContextReply)
	b := 1 // skip reply determinant

	if buf[b] == 1 {
		v.Enabled = true
	} else {
		v.Enabled = false
	}
	b += 1

	v.Sequence = xgb.Get16(buf[b:])
	b += 2

	v.Length = xgb.Get32(buf[b:]) // 4-byte units
	b += 4

	v.ElementHeader = ElementHeader(buf[b])
	b += 1

	b += 3 // padding

	v.NumInterceptedClients = xgb.Get32(buf[b:])
	b += 4

	b += 16 // padding

	v.InterceptedClients = make([]ClientInfo, v.NumInterceptedClients)
	b += ClientInfoReadList(buf[b:], v.InterceptedClients)

	return v
}
Exemplo n.º 6
0
// getBuffersReply reads a byte slice into a GetBuffersReply value.
func getBuffersReply(buf []byte) *GetBuffersReply {
	v := new(GetBuffersReply)
	b := 1 // skip reply determinant

	b += 1 // padding

	v.Sequence = xgb.Get16(buf[b:])
	b += 2

	v.Length = xgb.Get32(buf[b:]) // 4-byte units
	b += 4

	v.Width = xgb.Get32(buf[b:])
	b += 4

	v.Height = xgb.Get32(buf[b:])
	b += 4

	v.Count = xgb.Get32(buf[b:])
	b += 4

	b += 12 // padding

	v.Buffers = make([]DRI2Buffer, v.Count)
	b += DRI2BufferReadList(buf[b:], v.Buffers)

	return v
}
Exemplo n.º 7
0
// getParamReply reads a byte slice into a GetParamReply value.
func getParamReply(buf []byte) *GetParamReply {
	v := new(GetParamReply)
	b := 1 // skip reply determinant

	if buf[b] == 1 {
		v.IsParamRecognized = true
	} else {
		v.IsParamRecognized = false
	}
	b += 1

	v.Sequence = xgb.Get16(buf[b:])
	b += 2

	v.Length = xgb.Get32(buf[b:]) // 4-byte units
	b += 4

	v.ValueHi = xgb.Get32(buf[b:])
	b += 4

	v.ValueLo = xgb.Get32(buf[b:])
	b += 4

	return v
}
Exemplo n.º 8
0
// waitSBCReply reads a byte slice into a WaitSBCReply value.
func waitSBCReply(buf []byte) *WaitSBCReply {
	v := new(WaitSBCReply)
	b := 1 // skip reply determinant

	b += 1 // padding

	v.Sequence = xgb.Get16(buf[b:])
	b += 2

	v.Length = xgb.Get32(buf[b:]) // 4-byte units
	b += 4

	v.UstHi = xgb.Get32(buf[b:])
	b += 4

	v.UstLo = xgb.Get32(buf[b:])
	b += 4

	v.MscHi = xgb.Get32(buf[b:])
	b += 4

	v.MscLo = xgb.Get32(buf[b:])
	b += 4

	v.SbcHi = xgb.Get32(buf[b:])
	b += 4

	v.SbcLo = xgb.Get32(buf[b:])
	b += 4

	return v
}
Exemplo n.º 9
0
// queryVersionReply reads a byte slice into a QueryVersionReply value.
func queryVersionReply(buf []byte) *QueryVersionReply {
	v := new(QueryVersionReply)
	b := 1 // skip reply determinant

	b += 1 // padding

	v.Sequence = xgb.Get16(buf[b:])
	b += 2

	v.Length = xgb.Get32(buf[b:]) // 4-byte units
	b += 4

	v.MajorVersion = xgb.Get16(buf[b:])
	b += 2

	v.MinorVersion = xgb.Get16(buf[b:])
	b += 2

	return v
}
Exemplo n.º 10
0
// NotifyEventNew constructs a NotifyEvent value that implements xgb.Event from a byte slice.
func NotifyEventNew(buf []byte) xgb.Event {
	v := NotifyEvent{}
	b := 1 // don't read event number

	v.ShapeKind = Kind(buf[b])
	b += 1

	v.Sequence = xgb.Get16(buf[b:])
	b += 2

	v.AffectedWindow = xproto.Window(xgb.Get32(buf[b:]))
	b += 4

	v.ExtentsX = int16(xgb.Get16(buf[b:]))
	b += 2

	v.ExtentsY = int16(xgb.Get16(buf[b:]))
	b += 2

	v.ExtentsWidth = xgb.Get16(buf[b:])
	b += 2

	v.ExtentsHeight = xgb.Get16(buf[b:])
	b += 2

	v.ServerTime = xproto.Timestamp(xgb.Get32(buf[b:]))
	b += 4

	if buf[b] == 1 {
		v.Shaped = true
	} else {
		v.Shaped = false
	}
	b += 1

	b += 11 // padding

	return v
}
Exemplo n.º 11
0
// InvalidateBuffersEventNew constructs a InvalidateBuffersEvent value that implements xgb.Event from a byte slice.
func InvalidateBuffersEventNew(buf []byte) xgb.Event {
	v := InvalidateBuffersEvent{}
	b := 1 // don't read event number

	b += 1 // padding

	v.Sequence = xgb.Get16(buf[b:])
	b += 2

	v.Drawable = xproto.Drawable(xgb.Get32(buf[b:]))
	b += 4

	return v
}
Exemplo n.º 12
0
// copyRegionReply reads a byte slice into a CopyRegionReply value.
func copyRegionReply(buf []byte) *CopyRegionReply {
	v := new(CopyRegionReply)
	b := 1 // skip reply determinant

	b += 1 // padding

	v.Sequence = xgb.Get16(buf[b:])
	b += 2

	v.Length = xgb.Get32(buf[b:]) // 4-byte units
	b += 4

	return v
}
Exemplo n.º 13
0
// queryVersionReply reads a byte slice into a QueryVersionReply value.
func queryVersionReply(buf []byte) *QueryVersionReply {
	v := new(QueryVersionReply)
	b := 1 // skip reply determinant

	if buf[b] == 1 {
		v.SharedPixmaps = true
	} else {
		v.SharedPixmaps = false
	}
	b += 1

	v.Sequence = xgb.Get16(buf[b:])
	b += 2

	v.Length = xgb.Get32(buf[b:]) // 4-byte units
	b += 4

	v.MajorVersion = xgb.Get16(buf[b:])
	b += 2

	v.MinorVersion = xgb.Get16(buf[b:])
	b += 2

	v.Uid = xgb.Get16(buf[b:])
	b += 2

	v.Gid = xgb.Get16(buf[b:])
	b += 2

	v.PixmapFormat = buf[b]
	b += 1

	b += 15 // padding

	return v
}
Exemplo n.º 14
0
// BadContextErrorNew constructs a BadContextError value that implements xgb.Error from a byte slice.
func BadContextErrorNew(buf []byte) xgb.Error {
	v := BadContextError{}
	v.NiceName = "BadContext"

	b := 1 // skip error determinant
	b += 1 // don't read error number

	v.Sequence = xgb.Get16(buf[b:])
	b += 2

	v.InvalidRecord = xgb.Get32(buf[b:])
	b += 4

	return v
}
Exemplo n.º 15
0
// authenticateReply reads a byte slice into a AuthenticateReply value.
func authenticateReply(buf []byte) *AuthenticateReply {
	v := new(AuthenticateReply)
	b := 1 // skip reply determinant

	b += 1 // padding

	v.Sequence = xgb.Get16(buf[b:])
	b += 2

	v.Length = xgb.Get32(buf[b:]) // 4-byte units
	b += 4

	v.Authenticated = xgb.Get32(buf[b:])
	b += 4

	return v
}
Exemplo n.º 16
0
// getOverlayWindowReply reads a byte slice into a GetOverlayWindowReply value.
func getOverlayWindowReply(buf []byte) *GetOverlayWindowReply {
	v := new(GetOverlayWindowReply)
	b := 1 // skip reply determinant

	b += 1 // padding

	v.Sequence = xgb.Get16(buf[b:])
	b += 2

	v.Length = xgb.Get32(buf[b:]) // 4-byte units
	b += 4

	v.OverlayWin = xproto.Window(xgb.Get32(buf[b:]))
	b += 4

	b += 20 // padding

	return v
}
Exemplo n.º 17
0
// inputSelectedReply reads a byte slice into a InputSelectedReply value.
func inputSelectedReply(buf []byte) *InputSelectedReply {
	v := new(InputSelectedReply)
	b := 1 // skip reply determinant

	if buf[b] == 1 {
		v.Enabled = true
	} else {
		v.Enabled = false
	}
	b += 1

	v.Sequence = xgb.Get16(buf[b:])
	b += 2

	v.Length = xgb.Get32(buf[b:]) // 4-byte units
	b += 4

	return v
}
Exemplo n.º 18
0
// enableContextReply reads a byte slice into a EnableContextReply value.
func enableContextReply(buf []byte) *EnableContextReply {
	v := new(EnableContextReply)
	b := 1 // skip reply determinant

	v.Category = buf[b]
	b += 1

	v.Sequence = xgb.Get16(buf[b:])
	b += 2

	v.Length = xgb.Get32(buf[b:]) // 4-byte units
	b += 4

	v.ElementHeader = ElementHeader(buf[b])
	b += 1

	if buf[b] == 1 {
		v.ClientSwapped = true
	} else {
		v.ClientSwapped = false
	}
	b += 1

	b += 2 // padding

	v.XidBase = xgb.Get32(buf[b:])
	b += 4

	v.ServerTime = xgb.Get32(buf[b:])
	b += 4

	v.RecSequenceNum = xgb.Get32(buf[b:])
	b += 4

	b += 8 // padding

	v.Data = make([]byte, (int(v.Length) * 4))
	copy(v.Data[:(int(v.Length)*4)], buf[b:])
	b += xgb.Pad(int((int(v.Length) * 4)))

	return v
}
Exemplo n.º 19
0
// swapBuffersReply reads a byte slice into a SwapBuffersReply value.
func swapBuffersReply(buf []byte) *SwapBuffersReply {
	v := new(SwapBuffersReply)
	b := 1 // skip reply determinant

	b += 1 // padding

	v.Sequence = xgb.Get16(buf[b:])
	b += 2

	v.Length = xgb.Get32(buf[b:]) // 4-byte units
	b += 4

	v.SwapHi = xgb.Get32(buf[b:])
	b += 4

	v.SwapLo = xgb.Get32(buf[b:])
	b += 4

	return v
}
Exemplo n.º 20
0
// getImageReply reads a byte slice into a GetImageReply value.
func getImageReply(buf []byte) *GetImageReply {
	v := new(GetImageReply)
	b := 1 // skip reply determinant

	v.Depth = buf[b]
	b += 1

	v.Sequence = xgb.Get16(buf[b:])
	b += 2

	v.Length = xgb.Get32(buf[b:]) // 4-byte units
	b += 4

	v.Visual = xproto.Visualid(xgb.Get32(buf[b:]))
	b += 4

	v.Size = xgb.Get32(buf[b:])
	b += 4

	return v
}
Exemplo n.º 21
0
// connectReply reads a byte slice into a ConnectReply value.
func connectReply(buf []byte) *ConnectReply {
	v := new(ConnectReply)
	b := 1 // skip reply determinant

	b += 1 // padding

	v.Sequence = xgb.Get16(buf[b:])
	b += 2

	v.Length = xgb.Get32(buf[b:]) // 4-byte units
	b += 4

	v.DriverNameLength = xgb.Get32(buf[b:])
	b += 4

	v.DeviceNameLength = xgb.Get32(buf[b:])
	b += 4

	b += 16 // padding

	{
		byteString := make([]byte, v.DriverNameLength)
		copy(byteString[:v.DriverNameLength], buf[b:])
		v.DriverName = string(byteString)
		b += xgb.Pad(int(v.DriverNameLength))
	}

	v.AlignmentPad = make([]byte, (((int(v.DriverNameLength) + 3) & -4) - int(v.DriverNameLength)))
	copy(v.AlignmentPad[:(((int(v.DriverNameLength)+3)&-4)-int(v.DriverNameLength))], buf[b:])
	b += xgb.Pad(int((((int(v.DriverNameLength) + 3) & -4) - int(v.DriverNameLength))))

	{
		byteString := make([]byte, v.DeviceNameLength)
		copy(byteString[:v.DeviceNameLength], buf[b:])
		v.DeviceName = string(byteString)
		b += xgb.Pad(int(v.DeviceNameLength))
	}

	return v
}
Exemplo n.º 22
0
// getRectanglesReply reads a byte slice into a GetRectanglesReply value.
func getRectanglesReply(buf []byte) *GetRectanglesReply {
	v := new(GetRectanglesReply)
	b := 1 // skip reply determinant

	v.Ordering = buf[b]
	b += 1

	v.Sequence = xgb.Get16(buf[b:])
	b += 2

	v.Length = xgb.Get32(buf[b:]) // 4-byte units
	b += 4

	v.RectanglesLen = xgb.Get32(buf[b:])
	b += 4

	b += 20 // padding

	v.Rectangles = make([]xproto.Rectangle, v.RectanglesLen)
	b += xproto.RectangleReadList(buf[b:], v.Rectangles)

	return v
}