當前位置: 首頁>>代碼示例>>Golang>>正文


Golang xgb.Get32函數代碼示例

本文整理匯總了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
}
開發者ID:Nightgunner5,項目名稱:xgb,代碼行數:29,代碼來源:dri2.go

示例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
}
開發者ID:Nightgunner5,項目名稱:xgb,代碼行數:33,代碼來源:record.go

示例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
}
開發者ID:Nightgunner5,項目名稱:xgb,代碼行數:26,代碼來源:dri2.go

示例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
}
開發者ID:Nightgunner5,項目名稱:xgb,代碼行數:29,代碼來源:shm.go

示例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
}
開發者ID:Nightgunner5,項目名稱:xgb,代碼行數:12,代碼來源:dri2.go

示例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
}
開發者ID:Nightgunner5,項目名稱:xgb,代碼行數:15,代碼來源:record.go

示例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
}
開發者ID:Nightgunner5,項目名稱:xgb,代碼行數:18,代碼來源:dri2.go

示例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
}
開發者ID:Nightgunner5,項目名稱:xgb,代碼行數:33,代碼來源:dri2.go

示例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
}
開發者ID:Nightgunner5,項目名稱:xgbutil,代碼行數:12,代碼來源:xprop.go

示例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
}
開發者ID:Nightgunner5,項目名稱:xgb,代碼行數:20,代碼來源:composite.go

示例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
}
開發者ID:Nightgunner5,項目名稱:xgb,代碼行數:43,代碼來源:record.go

示例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
}
開發者ID:Nightgunner5,項目名稱:xgb,代碼行數:55,代碼來源:shape.go

示例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
}
開發者ID:Nightgunner5,項目名稱:xgb,代碼行數:21,代碼來源:dri2.go

示例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
}
開發者ID:Nightgunner5,項目名稱:xgb,代碼行數:21,代碼來源:dri2.go

示例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
}
開發者ID:Nightgunner5,項目名稱:xgb,代碼行數:21,代碼來源:dri2.go


注:本文中的github.com/Nightgunner5/xgb.Get32函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。