better docs

This commit is contained in:
Andrew Gallant (Ocelot)
2012-05-10 23:57:34 -04:00
parent a3363755cd
commit c00652934e
34 changed files with 6734 additions and 4688 deletions

View File

@@ -2,7 +2,7 @@
package xvmc
/*
This file was generated by xvmc.xml on May 10 2012 8:04:33pm EDT.
This file was generated by xvmc.xml on May 10 2012 11:56:20pm EDT.
This file is automatically generated. Edit at your peril!
*/
@@ -41,6 +41,16 @@ func init() {
xgb.NewExtErrorFuncs["XVideo-MotionCompensation"] = make(map[int]xgb.NewErrorFun)
}
// Skipping definition for base type 'Card16'
// Skipping definition for base type 'Char'
// Skipping definition for base type 'Card32'
// Skipping definition for base type 'Double'
// Skipping definition for base type 'Bool'
// Skipping definition for base type 'Float'
// Skipping definition for base type 'Card8'
@@ -55,16 +65,6 @@ func init() {
// Skipping definition for base type 'Int8'
// Skipping definition for base type 'Card16'
// Skipping definition for base type 'Char'
// Skipping definition for base type 'Card32'
// Skipping definition for base type 'Double'
// Skipping definition for base type 'Bool'
type Context uint32
func NewContextId(c *xgb.Conn) (Context, error) {
@@ -95,8 +95,6 @@ func NewSubpictureId(c *xgb.Conn) (Subpicture, error) {
return Subpicture(id), nil
}
// 'SurfaceInfo' struct definition
// Size: 24
type SurfaceInfo struct {
Id Surface
ChromaFormat uint16
@@ -109,7 +107,7 @@ type SurfaceInfo struct {
Flags uint32
}
// Struct read SurfaceInfo
// SurfaceInfoRead reads a byte slice into a SurfaceInfo value.
func SurfaceInfoRead(buf []byte, v *SurfaceInfo) int {
b := 0
@@ -143,7 +141,7 @@ func SurfaceInfoRead(buf []byte, v *SurfaceInfo) int {
return b
}
// Struct list read SurfaceInfo
// SurfaceInfoReadList reads a byte slice into a list of SurfaceInfo values.
func SurfaceInfoReadList(buf []byte, dest []SurfaceInfo) int {
b := 0
for i := 0; i < len(dest); i++ {
@@ -153,7 +151,7 @@ func SurfaceInfoReadList(buf []byte, dest []SurfaceInfo) int {
return xgb.Pad(b)
}
// Struct write SurfaceInfo
// Bytes writes a SurfaceInfo value to a byte slice.
func (v SurfaceInfo) Bytes() []byte {
buf := make([]byte, 24)
b := 0
@@ -188,7 +186,7 @@ func (v SurfaceInfo) Bytes() []byte {
return buf
}
// Write struct list SurfaceInfo
// SurfaceInfoListBytes writes a list of %s(MISSING) values to a byte slice.
func SurfaceInfoListBytes(buf []byte, list []SurfaceInfo) int {
b := 0
var structBytes []byte
@@ -200,35 +198,37 @@ func SurfaceInfoListBytes(buf []byte, list []SurfaceInfo) int {
return b
}
// Request QueryVersion
// size: 4
// QueryVersionCookie is a cookie used only for QueryVersion requests.
type QueryVersionCookie struct {
*xgb.Cookie
}
// QueryVersion sends a checked request.
// If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply()
func QueryVersion(c *xgb.Conn) QueryVersionCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(queryVersionRequest(c), cookie)
return QueryVersionCookie{cookie}
}
// QueryVersionUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func QueryVersionUnchecked(c *xgb.Conn) QueryVersionCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(queryVersionRequest(c), cookie)
return QueryVersionCookie{cookie}
}
// Request reply for QueryVersion
// size: 16
// QueryVersionReply represents the data returned from a QueryVersion request.
type QueryVersionReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
// padding: 1 bytes
Major uint32
Minor uint32
}
// Waits and reads reply data from request QueryVersion
// Reply blocks and returns the reply data for a QueryVersion request.
func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@@ -240,7 +240,7 @@ func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error) {
return queryVersionReply(buf), nil
}
// Read reply into structure from buffer for QueryVersion
// queryVersionReply reads a byte slice into a QueryVersionReply value.
func queryVersionReply(buf []byte) *QueryVersionReply {
v := new(QueryVersionReply)
b := 1 // skip reply determinant
@@ -263,6 +263,7 @@ func queryVersionReply(buf []byte) *QueryVersionReply {
}
// Write request to wire for QueryVersion
// queryVersionRequest writes a QueryVersion request to a byte slice.
func queryVersionRequest(c *xgb.Conn) []byte {
size := 4
b := 0
@@ -280,36 +281,38 @@ func queryVersionRequest(c *xgb.Conn) []byte {
return buf
}
// Request ListSurfaceTypes
// size: 8
// ListSurfaceTypesCookie is a cookie used only for ListSurfaceTypes requests.
type ListSurfaceTypesCookie struct {
*xgb.Cookie
}
// ListSurfaceTypes sends a checked request.
// If an error occurs, it will be returned with the reply by calling ListSurfaceTypesCookie.Reply()
func ListSurfaceTypes(c *xgb.Conn, PortId xv.Port) ListSurfaceTypesCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(listSurfaceTypesRequest(c, PortId), cookie)
return ListSurfaceTypesCookie{cookie}
}
// ListSurfaceTypesUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func ListSurfaceTypesUnchecked(c *xgb.Conn, PortId xv.Port) ListSurfaceTypesCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(listSurfaceTypesRequest(c, PortId), cookie)
return ListSurfaceTypesCookie{cookie}
}
// Request reply for ListSurfaceTypes
// size: (32 + xgb.Pad((int(Num) * 24)))
// ListSurfaceTypesReply represents the data returned from a ListSurfaceTypes request.
type ListSurfaceTypesReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
// padding: 1 bytes
Num uint32
// padding: 20 bytes
Surfaces []SurfaceInfo // size: xgb.Pad((int(Num) * 24))
}
// Waits and reads reply data from request ListSurfaceTypes
// Reply blocks and returns the reply data for a ListSurfaceTypes request.
func (cook ListSurfaceTypesCookie) Reply() (*ListSurfaceTypesReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@@ -321,7 +324,7 @@ func (cook ListSurfaceTypesCookie) Reply() (*ListSurfaceTypesReply, error) {
return listSurfaceTypesReply(buf), nil
}
// Read reply into structure from buffer for ListSurfaceTypes
// listSurfaceTypesReply reads a byte slice into a ListSurfaceTypesReply value.
func listSurfaceTypesReply(buf []byte) *ListSurfaceTypesReply {
v := new(ListSurfaceTypesReply)
b := 1 // skip reply determinant
@@ -346,6 +349,7 @@ func listSurfaceTypesReply(buf []byte) *ListSurfaceTypesReply {
}
// Write request to wire for ListSurfaceTypes
// listSurfaceTypesRequest writes a ListSurfaceTypes request to a byte slice.
func listSurfaceTypesRequest(c *xgb.Conn, PortId xv.Port) []byte {
size := 8
b := 0
@@ -366,29 +370,31 @@ func listSurfaceTypesRequest(c *xgb.Conn, PortId xv.Port) []byte {
return buf
}
// Request CreateContext
// size: 24
// CreateContextCookie is a cookie used only for CreateContext requests.
type CreateContextCookie struct {
*xgb.Cookie
}
// CreateContext sends a checked request.
// If an error occurs, it will be returned with the reply by calling CreateContextCookie.Reply()
func CreateContext(c *xgb.Conn, ContextId Context, PortId xv.Port, SurfaceId Surface, Width uint16, Height uint16, Flags uint32) CreateContextCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(createContextRequest(c, ContextId, PortId, SurfaceId, Width, Height, Flags), cookie)
return CreateContextCookie{cookie}
}
// CreateContextUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func CreateContextUnchecked(c *xgb.Conn, ContextId Context, PortId xv.Port, SurfaceId Surface, Width uint16, Height uint16, Flags uint32) CreateContextCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(createContextRequest(c, ContextId, PortId, SurfaceId, Width, Height, Flags), cookie)
return CreateContextCookie{cookie}
}
// Request reply for CreateContext
// size: (36 + xgb.Pad((int(Length) * 4)))
// CreateContextReply represents the data returned from a CreateContext request.
type CreateContextReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
// padding: 1 bytes
WidthActual uint16
HeightActual uint16
@@ -397,7 +403,7 @@ type CreateContextReply struct {
PrivData []uint32 // size: xgb.Pad((int(Length) * 4))
}
// Waits and reads reply data from request CreateContext
// Reply blocks and returns the reply data for a CreateContext request.
func (cook CreateContextCookie) Reply() (*CreateContextReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@@ -409,7 +415,7 @@ func (cook CreateContextCookie) Reply() (*CreateContextReply, error) {
return createContextReply(buf), nil
}
// Read reply into structure from buffer for CreateContext
// createContextReply reads a byte slice into a CreateContextReply value.
func createContextReply(buf []byte) *CreateContextReply {
v := new(CreateContextReply)
b := 1 // skip reply determinant
@@ -444,6 +450,7 @@ func createContextReply(buf []byte) *CreateContextReply {
}
// Write request to wire for CreateContext
// createContextRequest writes a CreateContext request to a byte slice.
func createContextRequest(c *xgb.Conn, ContextId Context, PortId xv.Port, SurfaceId Surface, Width uint16, Height uint16, Flags uint32) []byte {
size := 24
b := 0
@@ -479,30 +486,35 @@ func createContextRequest(c *xgb.Conn, ContextId Context, PortId xv.Port, Surfac
return buf
}
// Request DestroyContext
// size: 8
// DestroyContextCookie is a cookie used only for DestroyContext requests.
type DestroyContextCookie struct {
*xgb.Cookie
}
// Write request to wire for DestroyContext
// DestroyContext sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func DestroyContext(c *xgb.Conn, ContextId Context) DestroyContextCookie {
cookie := c.NewCookie(false, false)
c.NewRequest(destroyContextRequest(c, ContextId), cookie)
return DestroyContextCookie{cookie}
}
// DestroyContextChecked sends a checked request.
// If an error occurs, it can be retrieved using DestroyContextCookie.Check()
func DestroyContextChecked(c *xgb.Conn, ContextId Context) DestroyContextCookie {
cookie := c.NewCookie(true, false)
c.NewRequest(destroyContextRequest(c, ContextId), cookie)
return DestroyContextCookie{cookie}
}
// Check returns an error if one occurred for checked requests that are not expecting a reply.
// This cannot be called for requests expecting a reply, nor for unchecked requests.
func (cook DestroyContextCookie) Check() error {
return cook.Cookie.Check()
}
// Write request to wire for DestroyContext
// destroyContextRequest writes a DestroyContext request to a byte slice.
func destroyContextRequest(c *xgb.Conn, ContextId Context) []byte {
size := 8
b := 0
@@ -523,35 +535,37 @@ func destroyContextRequest(c *xgb.Conn, ContextId Context) []byte {
return buf
}
// Request CreateSurface
// size: 12
// CreateSurfaceCookie is a cookie used only for CreateSurface requests.
type CreateSurfaceCookie struct {
*xgb.Cookie
}
// CreateSurface sends a checked request.
// If an error occurs, it will be returned with the reply by calling CreateSurfaceCookie.Reply()
func CreateSurface(c *xgb.Conn, SurfaceId Surface, ContextId Context) CreateSurfaceCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(createSurfaceRequest(c, SurfaceId, ContextId), cookie)
return CreateSurfaceCookie{cookie}
}
// CreateSurfaceUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func CreateSurfaceUnchecked(c *xgb.Conn, SurfaceId Surface, ContextId Context) CreateSurfaceCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(createSurfaceRequest(c, SurfaceId, ContextId), cookie)
return CreateSurfaceCookie{cookie}
}
// Request reply for CreateSurface
// size: (32 + xgb.Pad((int(Length) * 4)))
// CreateSurfaceReply represents the data returned from a CreateSurface request.
type CreateSurfaceReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
// padding: 1 bytes
// padding: 24 bytes
PrivData []uint32 // size: xgb.Pad((int(Length) * 4))
}
// Waits and reads reply data from request CreateSurface
// Reply blocks and returns the reply data for a CreateSurface request.
func (cook CreateSurfaceCookie) Reply() (*CreateSurfaceReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@@ -563,7 +577,7 @@ func (cook CreateSurfaceCookie) Reply() (*CreateSurfaceReply, error) {
return createSurfaceReply(buf), nil
}
// Read reply into structure from buffer for CreateSurface
// createSurfaceReply reads a byte slice into a CreateSurfaceReply value.
func createSurfaceReply(buf []byte) *CreateSurfaceReply {
v := new(CreateSurfaceReply)
b := 1 // skip reply determinant
@@ -589,6 +603,7 @@ func createSurfaceReply(buf []byte) *CreateSurfaceReply {
}
// Write request to wire for CreateSurface
// createSurfaceRequest writes a CreateSurface request to a byte slice.
func createSurfaceRequest(c *xgb.Conn, SurfaceId Surface, ContextId Context) []byte {
size := 12
b := 0
@@ -612,30 +627,35 @@ func createSurfaceRequest(c *xgb.Conn, SurfaceId Surface, ContextId Context) []b
return buf
}
// Request DestroySurface
// size: 8
// DestroySurfaceCookie is a cookie used only for DestroySurface requests.
type DestroySurfaceCookie struct {
*xgb.Cookie
}
// Write request to wire for DestroySurface
// DestroySurface sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func DestroySurface(c *xgb.Conn, SurfaceId Surface) DestroySurfaceCookie {
cookie := c.NewCookie(false, false)
c.NewRequest(destroySurfaceRequest(c, SurfaceId), cookie)
return DestroySurfaceCookie{cookie}
}
// DestroySurfaceChecked sends a checked request.
// If an error occurs, it can be retrieved using DestroySurfaceCookie.Check()
func DestroySurfaceChecked(c *xgb.Conn, SurfaceId Surface) DestroySurfaceCookie {
cookie := c.NewCookie(true, false)
c.NewRequest(destroySurfaceRequest(c, SurfaceId), cookie)
return DestroySurfaceCookie{cookie}
}
// Check returns an error if one occurred for checked requests that are not expecting a reply.
// This cannot be called for requests expecting a reply, nor for unchecked requests.
func (cook DestroySurfaceCookie) Check() error {
return cook.Cookie.Check()
}
// Write request to wire for DestroySurface
// destroySurfaceRequest writes a DestroySurface request to a byte slice.
func destroySurfaceRequest(c *xgb.Conn, SurfaceId Surface) []byte {
size := 8
b := 0
@@ -656,29 +676,31 @@ func destroySurfaceRequest(c *xgb.Conn, SurfaceId Surface) []byte {
return buf
}
// Request CreateSubpicture
// size: 20
// CreateSubpictureCookie is a cookie used only for CreateSubpicture requests.
type CreateSubpictureCookie struct {
*xgb.Cookie
}
// CreateSubpicture sends a checked request.
// If an error occurs, it will be returned with the reply by calling CreateSubpictureCookie.Reply()
func CreateSubpicture(c *xgb.Conn, SubpictureId Subpicture, Context Context, XvimageId uint32, Width uint16, Height uint16) CreateSubpictureCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(createSubpictureRequest(c, SubpictureId, Context, XvimageId, Width, Height), cookie)
return CreateSubpictureCookie{cookie}
}
// CreateSubpictureUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func CreateSubpictureUnchecked(c *xgb.Conn, SubpictureId Subpicture, Context Context, XvimageId uint32, Width uint16, Height uint16) CreateSubpictureCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(createSubpictureRequest(c, SubpictureId, Context, XvimageId, Width, Height), cookie)
return CreateSubpictureCookie{cookie}
}
// Request reply for CreateSubpicture
// size: (32 + xgb.Pad((int(Length) * 4)))
// CreateSubpictureReply represents the data returned from a CreateSubpicture request.
type CreateSubpictureReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
// padding: 1 bytes
WidthActual uint16
HeightActual uint16
@@ -689,7 +711,7 @@ type CreateSubpictureReply struct {
PrivData []uint32 // size: xgb.Pad((int(Length) * 4))
}
// Waits and reads reply data from request CreateSubpicture
// Reply blocks and returns the reply data for a CreateSubpicture request.
func (cook CreateSubpictureCookie) Reply() (*CreateSubpictureReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@@ -701,7 +723,7 @@ func (cook CreateSubpictureCookie) Reply() (*CreateSubpictureReply, error) {
return createSubpictureReply(buf), nil
}
// Read reply into structure from buffer for CreateSubpicture
// createSubpictureReply reads a byte slice into a CreateSubpictureReply value.
func createSubpictureReply(buf []byte) *CreateSubpictureReply {
v := new(CreateSubpictureReply)
b := 1 // skip reply determinant
@@ -743,6 +765,7 @@ func createSubpictureReply(buf []byte) *CreateSubpictureReply {
}
// Write request to wire for CreateSubpicture
// createSubpictureRequest writes a CreateSubpicture request to a byte slice.
func createSubpictureRequest(c *xgb.Conn, SubpictureId Subpicture, Context Context, XvimageId uint32, Width uint16, Height uint16) []byte {
size := 20
b := 0
@@ -775,30 +798,35 @@ func createSubpictureRequest(c *xgb.Conn, SubpictureId Subpicture, Context Conte
return buf
}
// Request DestroySubpicture
// size: 8
// DestroySubpictureCookie is a cookie used only for DestroySubpicture requests.
type DestroySubpictureCookie struct {
*xgb.Cookie
}
// Write request to wire for DestroySubpicture
// DestroySubpicture sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func DestroySubpicture(c *xgb.Conn, SubpictureId Subpicture) DestroySubpictureCookie {
cookie := c.NewCookie(false, false)
c.NewRequest(destroySubpictureRequest(c, SubpictureId), cookie)
return DestroySubpictureCookie{cookie}
}
// DestroySubpictureChecked sends a checked request.
// If an error occurs, it can be retrieved using DestroySubpictureCookie.Check()
func DestroySubpictureChecked(c *xgb.Conn, SubpictureId Subpicture) DestroySubpictureCookie {
cookie := c.NewCookie(true, false)
c.NewRequest(destroySubpictureRequest(c, SubpictureId), cookie)
return DestroySubpictureCookie{cookie}
}
// Check returns an error if one occurred for checked requests that are not expecting a reply.
// This cannot be called for requests expecting a reply, nor for unchecked requests.
func (cook DestroySubpictureCookie) Check() error {
return cook.Cookie.Check()
}
// Write request to wire for DestroySubpicture
// destroySubpictureRequest writes a DestroySubpicture request to a byte slice.
func destroySubpictureRequest(c *xgb.Conn, SubpictureId Subpicture) []byte {
size := 8
b := 0
@@ -819,36 +847,38 @@ func destroySubpictureRequest(c *xgb.Conn, SubpictureId Subpicture) []byte {
return buf
}
// Request ListSubpictureTypes
// size: 12
// ListSubpictureTypesCookie is a cookie used only for ListSubpictureTypes requests.
type ListSubpictureTypesCookie struct {
*xgb.Cookie
}
// ListSubpictureTypes sends a checked request.
// If an error occurs, it will be returned with the reply by calling ListSubpictureTypesCookie.Reply()
func ListSubpictureTypes(c *xgb.Conn, PortId xv.Port, SurfaceId Surface) ListSubpictureTypesCookie {
cookie := c.NewCookie(true, true)
c.NewRequest(listSubpictureTypesRequest(c, PortId, SurfaceId), cookie)
return ListSubpictureTypesCookie{cookie}
}
// ListSubpictureTypesUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func ListSubpictureTypesUnchecked(c *xgb.Conn, PortId xv.Port, SurfaceId Surface) ListSubpictureTypesCookie {
cookie := c.NewCookie(false, true)
c.NewRequest(listSubpictureTypesRequest(c, PortId, SurfaceId), cookie)
return ListSubpictureTypesCookie{cookie}
}
// Request reply for ListSubpictureTypes
// size: (32 + xv.ImageFormatInfoListSize(Types))
// ListSubpictureTypesReply represents the data returned from a ListSubpictureTypes request.
type ListSubpictureTypesReply struct {
Sequence uint16
Length uint32
Sequence uint16 // sequence number of the request for this reply
Length uint32 // number of bytes in this reply
// padding: 1 bytes
Num uint32
// padding: 20 bytes
Types []xv.ImageFormatInfo // size: xv.ImageFormatInfoListSize(Types)
}
// Waits and reads reply data from request ListSubpictureTypes
// Reply blocks and returns the reply data for a ListSubpictureTypes request.
func (cook ListSubpictureTypesCookie) Reply() (*ListSubpictureTypesReply, error) {
buf, err := cook.Cookie.Reply()
if err != nil {
@@ -860,7 +890,7 @@ func (cook ListSubpictureTypesCookie) Reply() (*ListSubpictureTypesReply, error)
return listSubpictureTypesReply(buf), nil
}
// Read reply into structure from buffer for ListSubpictureTypes
// listSubpictureTypesReply reads a byte slice into a ListSubpictureTypesReply value.
func listSubpictureTypesReply(buf []byte) *ListSubpictureTypesReply {
v := new(ListSubpictureTypesReply)
b := 1 // skip reply determinant
@@ -885,6 +915,7 @@ func listSubpictureTypesReply(buf []byte) *ListSubpictureTypesReply {
}
// Write request to wire for ListSubpictureTypes
// listSubpictureTypesRequest writes a ListSubpictureTypes request to a byte slice.
func listSubpictureTypesRequest(c *xgb.Conn, PortId xv.Port, SurfaceId Surface) []byte {
size := 12
b := 0