本文整理匯總了Golang中github.com/Nightgunner5/xgb.Get32函數的典型用法代碼示例。如果您正苦於以下問題:Golang Get32函數的具體用法?Golang Get32怎麽用?Golang Get32使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了Get32函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: getBuffersReply
// 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
}
示例2: getContextReply
// 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
}
示例3: getParamReply
// 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
}
示例4: CompletionEventNew
// 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
}
示例5: AttachFormatRead
// AttachFormatRead reads a byte slice into a AttachFormat value.
func AttachFormatRead(buf []byte, v *AttachFormat) int {
b := 0
v.Attachment = xgb.Get32(buf[b:])
b += 4
v.Format = xgb.Get32(buf[b:])
b += 4
return b
}
示例6: ClientInfoRead
// ClientInfoRead reads a byte slice into a ClientInfo value.
func ClientInfoRead(buf []byte, v *ClientInfo) int {
b := 0
v.ClientResource = ClientSpec(xgb.Get32(buf[b:]))
b += 4
v.NumRanges = xgb.Get32(buf[b:])
b += 4
v.Ranges = make([]Range, v.NumRanges)
b += RangeReadList(buf[b:], v.Ranges)
return b
}
示例7: authenticateReply
// 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
}
示例8: waitSBCReply
// 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
}
示例9: PropValNum64
// PropValNum64 transforms a GetPropertyReply struct into a 64 bit
// integer. Useful when the property value is a single integer.
func PropValNum64(reply *xproto.GetPropertyReply, err error) (int64, error) {
if err != nil {
return 0, err
}
if reply.Format != 32 {
return 0, fmt.Errorf("PropValNum: Expected format 32 but got %d",
reply.Format)
}
return int64(xgb.Get32(reply.Value)), nil
}
示例10: getOverlayWindowReply
// 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
}
示例11: enableContextReply
// 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
}
示例12: queryExtentsReply
// 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
}
示例13: queryVersionReply
// 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.Get32(buf[b:])
b += 4
v.MinorVersion = xgb.Get32(buf[b:])
b += 4
return v
}
示例14: swapBuffersReply
// 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
}
示例15: DRI2BufferRead
// DRI2BufferRead reads a byte slice into a DRI2Buffer value.
func DRI2BufferRead(buf []byte, v *DRI2Buffer) int {
b := 0
v.Attachment = xgb.Get32(buf[b:])
b += 4
v.Name = xgb.Get32(buf[b:])
b += 4
v.Pitch = xgb.Get32(buf[b:])
b += 4
v.Cpp = xgb.Get32(buf[b:])
b += 4
v.Flags = xgb.Get32(buf[b:])
b += 4
return b
}