コード例 #1
0
ファイル: record.go プロジェクト: Nightgunner5/xgb
func NewContextId(c *xgb.Conn) (Context, error) {
	id, err := c.NewId()
	if err != nil {
		return 0, err
	}
	return Context(id), nil
}
コード例 #2
0
ファイル: shm.go プロジェクト: Nightgunner5/xgb
func NewSegId(c *xgb.Conn) (Seg, error) {
	id, err := c.NewId()
	if err != nil {
		return 0, err
	}
	return Seg(id), nil
}
コード例 #3
0
ファイル: dri2.go プロジェクト: Nightgunner5/xgb
// DestroyDrawableChecked sends a checked request.
// If an error occurs, it can be retrieved using DestroyDrawableCookie.Check()
func DestroyDrawableChecked(c *xgb.Conn, buf []byte, Drawable xproto.Drawable) (DestroyDrawableCookie, []byte) {
	if _, ok := c.Extensions["DRI2"]; !ok {
		panic("Cannot issue request 'DestroyDrawable' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.")
	}
	cookie := c.NewCookie(true, false)
	buf = destroyDrawableRequest(c, buf, Drawable)
	c.NewRequest(buf, cookie)
	return DestroyDrawableCookie{cookie}, buf
}
コード例 #4
0
ファイル: composite.go プロジェクト: Nightgunner5/xgb
// ReleaseOverlayWindowChecked sends a checked request.
// If an error occurs, it can be retrieved using ReleaseOverlayWindowCookie.Check()
func ReleaseOverlayWindowChecked(c *xgb.Conn, buf []byte, Window xproto.Window) (ReleaseOverlayWindowCookie, []byte) {
	if _, ok := c.Extensions["COMPOSITE"]; !ok {
		panic("Cannot issue request 'ReleaseOverlayWindow' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.")
	}
	cookie := c.NewCookie(true, false)
	buf = releaseOverlayWindowRequest(c, buf, Window)
	c.NewRequest(buf, cookie)
	return ReleaseOverlayWindowCookie{cookie}, buf
}
コード例 #5
0
ファイル: composite.go プロジェクト: Nightgunner5/xgb
// CreateRegionFromBorderClipChecked sends a checked request.
// If an error occurs, it can be retrieved using CreateRegionFromBorderClipCookie.Check()
func CreateRegionFromBorderClipChecked(c *xgb.Conn, buf []byte, Region xfixes.Region, Window xproto.Window) (CreateRegionFromBorderClipCookie, []byte) {
	if _, ok := c.Extensions["COMPOSITE"]; !ok {
		panic("Cannot issue request 'CreateRegionFromBorderClip' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.")
	}
	cookie := c.NewCookie(true, false)
	buf = createRegionFromBorderClipRequest(c, buf, Region, Window)
	c.NewRequest(buf, cookie)
	return CreateRegionFromBorderClipCookie{cookie}, buf
}
コード例 #6
0
ファイル: shm.go プロジェクト: Nightgunner5/xgb
// CreatePixmapChecked sends a checked request.
// If an error occurs, it can be retrieved using CreatePixmapCookie.Check()
func CreatePixmapChecked(c *xgb.Conn, buf []byte, Pid xproto.Pixmap, Drawable xproto.Drawable, Width uint16, Height uint16, Depth byte, Shmseg Seg, Offset uint32) (CreatePixmapCookie, []byte) {
	if _, ok := c.Extensions["MIT-SHM"]; !ok {
		panic("Cannot issue request 'CreatePixmap' using the uninitialized extension 'MIT-SHM'. shm.Init(connObj) must be called first.")
	}
	cookie := c.NewCookie(true, false)
	buf = createPixmapRequest(c, buf, Pid, Drawable, Width, Height, Depth, Shmseg, Offset)
	c.NewRequest(buf, cookie)
	return CreatePixmapCookie{cookie}, buf
}
コード例 #7
0
ファイル: shm.go プロジェクト: Nightgunner5/xgb
// GetImageUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func GetImageUnchecked(c *xgb.Conn, buf []byte, Drawable xproto.Drawable, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32, Format byte, Shmseg Seg, Offset uint32) (GetImageCookie, []byte) {
	if _, ok := c.Extensions["MIT-SHM"]; !ok {
		panic("Cannot issue request 'GetImage' using the uninitialized extension 'MIT-SHM'. shm.Init(connObj) must be called first.")
	}
	cookie := c.NewCookie(false, true)
	buf = getImageRequest(c, buf, Drawable, X, Y, Width, Height, PlaneMask, Format, Shmseg, Offset)
	c.NewRequest(buf, cookie)
	return GetImageCookie{cookie}, buf
}
コード例 #8
0
ファイル: shm.go プロジェクト: Nightgunner5/xgb
// DetachChecked sends a checked request.
// If an error occurs, it can be retrieved using DetachCookie.Check()
func DetachChecked(c *xgb.Conn, buf []byte, Shmseg Seg) (DetachCookie, []byte) {
	if _, ok := c.Extensions["MIT-SHM"]; !ok {
		panic("Cannot issue request 'Detach' using the uninitialized extension 'MIT-SHM'. shm.Init(connObj) must be called first.")
	}
	cookie := c.NewCookie(true, false)
	buf = detachRequest(c, buf, Shmseg)
	c.NewRequest(buf, cookie)
	return DetachCookie{cookie}, buf
}
コード例 #9
0
ファイル: shm.go プロジェクト: Nightgunner5/xgb
// 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, buf []byte) (QueryVersionCookie, []byte) {
	if _, ok := c.Extensions["MIT-SHM"]; !ok {
		panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'MIT-SHM'. shm.Init(connObj) must be called first.")
	}
	cookie := c.NewCookie(false, true)
	buf = queryVersionRequest(c, buf)
	c.NewRequest(buf, cookie)
	return QueryVersionCookie{cookie}, buf
}
コード例 #10
0
ファイル: shape.go プロジェクト: Nightgunner5/xgb
// OffsetChecked sends a checked request.
// If an error occurs, it can be retrieved using OffsetCookie.Check()
func OffsetChecked(c *xgb.Conn, buf []byte, DestinationKind Kind, DestinationWindow xproto.Window, XOffset int16, YOffset int16) (OffsetCookie, []byte) {
	if _, ok := c.Extensions["SHAPE"]; !ok {
		panic("Cannot issue request 'Offset' using the uninitialized extension 'SHAPE'. shape.Init(connObj) must be called first.")
	}
	cookie := c.NewCookie(true, false)
	buf = offsetRequest(c, buf, DestinationKind, DestinationWindow, XOffset, YOffset)
	c.NewRequest(buf, cookie)
	return OffsetCookie{cookie}, buf
}
コード例 #11
0
ファイル: shape.go プロジェクト: Nightgunner5/xgb
// CombineChecked sends a checked request.
// If an error occurs, it can be retrieved using CombineCookie.Check()
func CombineChecked(c *xgb.Conn, buf []byte, Operation Op, DestinationKind Kind, SourceKind Kind, DestinationWindow xproto.Window, XOffset int16, YOffset int16, SourceWindow xproto.Window) (CombineCookie, []byte) {
	if _, ok := c.Extensions["SHAPE"]; !ok {
		panic("Cannot issue request 'Combine' using the uninitialized extension 'SHAPE'. shape.Init(connObj) must be called first.")
	}
	cookie := c.NewCookie(true, false)
	buf = combineRequest(c, buf, Operation, DestinationKind, SourceKind, DestinationWindow, XOffset, YOffset, SourceWindow)
	c.NewRequest(buf, cookie)
	return CombineCookie{cookie}, buf
}
コード例 #12
0
ファイル: shape.go プロジェクト: Nightgunner5/xgb
// Mask sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func Mask(c *xgb.Conn, buf []byte, Operation Op, DestinationKind Kind, DestinationWindow xproto.Window, XOffset int16, YOffset int16, SourceBitmap xproto.Pixmap) (MaskCookie, []byte) {
	if _, ok := c.Extensions["SHAPE"]; !ok {
		panic("Cannot issue request 'Mask' using the uninitialized extension 'SHAPE'. shape.Init(connObj) must be called first.")
	}
	cookie := c.NewCookie(false, false)
	buf = maskRequest(c, buf, Operation, DestinationKind, DestinationWindow, XOffset, YOffset, SourceBitmap)
	c.NewRequest(buf, cookie)
	return MaskCookie{cookie}, buf
}
コード例 #13
0
ファイル: shape.go プロジェクト: Nightgunner5/xgb
// RectanglesChecked sends a checked request.
// If an error occurs, it can be retrieved using RectanglesCookie.Check()
func RectanglesChecked(c *xgb.Conn, buf []byte, Operation Op, DestinationKind Kind, Ordering byte, DestinationWindow xproto.Window, XOffset int16, YOffset int16, Rectangles []xproto.Rectangle) (RectanglesCookie, []byte) {
	if _, ok := c.Extensions["SHAPE"]; !ok {
		panic("Cannot issue request 'Rectangles' using the uninitialized extension 'SHAPE'. shape.Init(connObj) must be called first.")
	}
	cookie := c.NewCookie(true, false)
	buf = rectanglesRequest(c, buf, Operation, DestinationKind, Ordering, DestinationWindow, XOffset, YOffset, Rectangles)
	c.NewRequest(buf, cookie)
	return RectanglesCookie{cookie}, buf
}
コード例 #14
0
ファイル: shape.go プロジェクト: Nightgunner5/xgb
// 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, buf []byte) (QueryVersionCookie, []byte) {
	if _, ok := c.Extensions["SHAPE"]; !ok {
		panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'SHAPE'. shape.Init(connObj) must be called first.")
	}
	cookie := c.NewCookie(true, true)
	buf = queryVersionRequest(c, buf)
	c.NewRequest(buf, cookie)
	return QueryVersionCookie{cookie}, buf
}
コード例 #15
0
ファイル: dri2.go プロジェクト: Nightgunner5/xgb
// CopyRegionUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func CopyRegionUnchecked(c *xgb.Conn, buf []byte, Drawable xproto.Drawable, Region uint32, Dest uint32, Src uint32) (CopyRegionCookie, []byte) {
	if _, ok := c.Extensions["DRI2"]; !ok {
		panic("Cannot issue request 'CopyRegion' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.")
	}
	cookie := c.NewCookie(false, true)
	buf = copyRegionRequest(c, buf, Drawable, Region, Dest, Src)
	c.NewRequest(buf, cookie)
	return CopyRegionCookie{cookie}, buf
}
コード例 #16
0
ファイル: dri2.go プロジェクト: Nightgunner5/xgb
// GetBuffersUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func GetBuffersUnchecked(c *xgb.Conn, buf []byte, Drawable xproto.Drawable, Count uint32, Attachments []uint32) (GetBuffersCookie, []byte) {
	if _, ok := c.Extensions["DRI2"]; !ok {
		panic("Cannot issue request 'GetBuffers' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.")
	}
	cookie := c.NewCookie(false, true)
	buf = getBuffersRequest(c, buf, Drawable, Count, Attachments)
	c.NewRequest(buf, cookie)
	return GetBuffersCookie{cookie}, buf
}
コード例 #17
0
ファイル: record.go プロジェクト: Nightgunner5/xgb
// EnableContextUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func EnableContextUnchecked(c *xgb.Conn, buf []byte, Context Context) (EnableContextCookie, []byte) {
	if _, ok := c.Extensions["RECORD"]; !ok {
		panic("Cannot issue request 'EnableContext' using the uninitialized extension 'RECORD'. record.Init(connObj) must be called first.")
	}
	cookie := c.NewCookie(false, true)
	buf = enableContextRequest(c, buf, Context)
	c.NewRequest(buf, cookie)
	return EnableContextCookie{cookie}, buf
}
コード例 #18
0
ファイル: shape.go プロジェクト: Nightgunner5/xgb
// QueryExtents sends a checked request.
// If an error occurs, it will be returned with the reply by calling QueryExtentsCookie.Reply()
func QueryExtents(c *xgb.Conn, buf []byte, DestinationWindow xproto.Window) (QueryExtentsCookie, []byte) {
	if _, ok := c.Extensions["SHAPE"]; !ok {
		panic("Cannot issue request 'QueryExtents' using the uninitialized extension 'SHAPE'. shape.Init(connObj) must be called first.")
	}
	cookie := c.NewCookie(true, true)
	buf = queryExtentsRequest(c, buf, DestinationWindow)
	c.NewRequest(buf, cookie)
	return QueryExtentsCookie{cookie}, buf
}
コード例 #19
0
ファイル: shm.go プロジェクト: Nightgunner5/xgb
// Attach sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func Attach(c *xgb.Conn, buf []byte, Shmseg Seg, Shmid uint32, ReadOnly bool) (AttachCookie, []byte) {
	if _, ok := c.Extensions["MIT-SHM"]; !ok {
		panic("Cannot issue request 'Attach' using the uninitialized extension 'MIT-SHM'. shm.Init(connObj) must be called first.")
	}
	cookie := c.NewCookie(false, false)
	buf = attachRequest(c, buf, Shmseg, Shmid, ReadOnly)
	c.NewRequest(buf, cookie)
	return AttachCookie{cookie}, buf
}
コード例 #20
0
ファイル: shape.go プロジェクト: Nightgunner5/xgb
// SelectInputChecked sends a checked request.
// If an error occurs, it can be retrieved using SelectInputCookie.Check()
func SelectInputChecked(c *xgb.Conn, buf []byte, DestinationWindow xproto.Window, Enable bool) (SelectInputCookie, []byte) {
	if _, ok := c.Extensions["SHAPE"]; !ok {
		panic("Cannot issue request 'SelectInput' using the uninitialized extension 'SHAPE'. shape.Init(connObj) must be called first.")
	}
	cookie := c.NewCookie(true, false)
	buf = selectInputRequest(c, buf, DestinationWindow, Enable)
	c.NewRequest(buf, cookie)
	return SelectInputCookie{cookie}, buf
}
コード例 #21
0
ファイル: shm.go プロジェクト: Nightgunner5/xgb
// PutImageChecked sends a checked request.
// If an error occurs, it can be retrieved using PutImageCookie.Check()
func PutImageChecked(c *xgb.Conn, buf []byte, Drawable xproto.Drawable, Gc xproto.Gcontext, TotalWidth uint16, TotalHeight uint16, SrcX uint16, SrcY uint16, SrcWidth uint16, SrcHeight uint16, DstX int16, DstY int16, Depth byte, Format byte, SendEvent byte, Shmseg Seg, Offset uint32) (PutImageCookie, []byte) {
	if _, ok := c.Extensions["MIT-SHM"]; !ok {
		panic("Cannot issue request 'PutImage' using the uninitialized extension 'MIT-SHM'. shm.Init(connObj) must be called first.")
	}
	cookie := c.NewCookie(true, false)
	buf = putImageRequest(c, buf, Drawable, Gc, TotalWidth, TotalHeight, SrcX, SrcY, SrcWidth, SrcHeight, DstX, DstY, Depth, Format, SendEvent, Shmseg, Offset)
	c.NewRequest(buf, cookie)
	return PutImageCookie{cookie}, buf
}
コード例 #22
0
ファイル: shape.go プロジェクト: Nightgunner5/xgb
// InputSelectedUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func InputSelectedUnchecked(c *xgb.Conn, buf []byte, DestinationWindow xproto.Window) (InputSelectedCookie, []byte) {
	if _, ok := c.Extensions["SHAPE"]; !ok {
		panic("Cannot issue request 'InputSelected' using the uninitialized extension 'SHAPE'. shape.Init(connObj) must be called first.")
	}
	cookie := c.NewCookie(false, true)
	buf = inputSelectedRequest(c, buf, DestinationWindow)
	c.NewRequest(buf, cookie)
	return InputSelectedCookie{cookie}, buf
}
コード例 #23
0
ファイル: shape.go プロジェクト: Nightgunner5/xgb
// GetRectanglesUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func GetRectanglesUnchecked(c *xgb.Conn, buf []byte, Window xproto.Window, SourceKind Kind) (GetRectanglesCookie, []byte) {
	if _, ok := c.Extensions["SHAPE"]; !ok {
		panic("Cannot issue request 'GetRectangles' using the uninitialized extension 'SHAPE'. shape.Init(connObj) must be called first.")
	}
	cookie := c.NewCookie(false, true)
	buf = getRectanglesRequest(c, buf, Window, SourceKind)
	c.NewRequest(buf, cookie)
	return GetRectanglesCookie{cookie}, buf
}
コード例 #24
0
ファイル: record.go プロジェクト: Nightgunner5/xgb
// 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, buf []byte, MajorVersion uint16, MinorVersion uint16) (QueryVersionCookie, []byte) {
	if _, ok := c.Extensions["RECORD"]; !ok {
		panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'RECORD'. record.Init(connObj) must be called first.")
	}
	cookie := c.NewCookie(false, true)
	buf = queryVersionRequest(c, buf, MajorVersion, MinorVersion)
	c.NewRequest(buf, cookie)
	return QueryVersionCookie{cookie}, buf
}
コード例 #25
0
ファイル: composite.go プロジェクト: Nightgunner5/xgb
// UnredirectSubwindowsChecked sends a checked request.
// If an error occurs, it can be retrieved using UnredirectSubwindowsCookie.Check()
func UnredirectSubwindowsChecked(c *xgb.Conn, buf []byte, Window xproto.Window, Update byte) (UnredirectSubwindowsCookie, []byte) {
	if _, ok := c.Extensions["COMPOSITE"]; !ok {
		panic("Cannot issue request 'UnredirectSubwindows' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.")
	}
	cookie := c.NewCookie(true, false)
	buf = unredirectSubwindowsRequest(c, buf, Window, Update)
	c.NewRequest(buf, cookie)
	return UnredirectSubwindowsCookie{cookie}, buf
}
コード例 #26
0
ファイル: record.go プロジェクト: Nightgunner5/xgb
// RegisterClients sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func RegisterClients(c *xgb.Conn, buf []byte, Context Context, ElementHeader ElementHeader, NumClientSpecs uint32, NumRanges uint32, ClientSpecs []ClientSpec, Ranges []Range) (RegisterClientsCookie, []byte) {
	if _, ok := c.Extensions["RECORD"]; !ok {
		panic("Cannot issue request 'RegisterClients' using the uninitialized extension 'RECORD'. record.Init(connObj) must be called first.")
	}
	cookie := c.NewCookie(false, false)
	buf = registerClientsRequest(c, buf, Context, ElementHeader, NumClientSpecs, NumRanges, ClientSpecs, Ranges)
	c.NewRequest(buf, cookie)
	return RegisterClientsCookie{cookie}, buf
}
コード例 #27
0
ファイル: composite.go プロジェクト: Nightgunner5/xgb
// NameWindowPixmapChecked sends a checked request.
// If an error occurs, it can be retrieved using NameWindowPixmapCookie.Check()
func NameWindowPixmapChecked(c *xgb.Conn, buf []byte, Window xproto.Window, Pixmap xproto.Pixmap) (NameWindowPixmapCookie, []byte) {
	if _, ok := c.Extensions["COMPOSITE"]; !ok {
		panic("Cannot issue request 'NameWindowPixmap' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.")
	}
	cookie := c.NewCookie(true, false)
	buf = nameWindowPixmapRequest(c, buf, Window, Pixmap)
	c.NewRequest(buf, cookie)
	return NameWindowPixmapCookie{cookie}, buf
}
コード例 #28
0
ファイル: record.go プロジェクト: Nightgunner5/xgb
// UnregisterClientsChecked sends a checked request.
// If an error occurs, it can be retrieved using UnregisterClientsCookie.Check()
func UnregisterClientsChecked(c *xgb.Conn, buf []byte, Context Context, NumClientSpecs uint32, ClientSpecs []ClientSpec) (UnregisterClientsCookie, []byte) {
	if _, ok := c.Extensions["RECORD"]; !ok {
		panic("Cannot issue request 'UnregisterClients' using the uninitialized extension 'RECORD'. record.Init(connObj) must be called first.")
	}
	cookie := c.NewCookie(true, false)
	buf = unregisterClientsRequest(c, buf, Context, NumClientSpecs, ClientSpecs)
	c.NewRequest(buf, cookie)
	return UnregisterClientsCookie{cookie}, buf
}
コード例 #29
0
ファイル: composite.go プロジェクト: Nightgunner5/xgb
// 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, buf []byte, ClientMajorVersion uint32, ClientMinorVersion uint32) (QueryVersionCookie, []byte) {
	if _, ok := c.Extensions["COMPOSITE"]; !ok {
		panic("Cannot issue request 'QueryVersion' using the uninitialized extension 'Composite'. composite.Init(connObj) must be called first.")
	}
	cookie := c.NewCookie(false, true)
	buf = queryVersionRequest(c, buf, ClientMajorVersion, ClientMinorVersion)
	c.NewRequest(buf, cookie)
	return QueryVersionCookie{cookie}, buf
}
コード例 #30
0
ファイル: dri2.go プロジェクト: Nightgunner5/xgb
// AuthenticateUnchecked sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
func AuthenticateUnchecked(c *xgb.Conn, buf []byte, Window xproto.Window, Magic uint32) (AuthenticateCookie, []byte) {
	if _, ok := c.Extensions["DRI2"]; !ok {
		panic("Cannot issue request 'Authenticate' using the uninitialized extension 'DRI2'. dri2.Init(connObj) must be called first.")
	}
	cookie := c.NewCookie(false, true)
	buf = authenticateRequest(c, buf, Window, Magic)
	c.NewRequest(buf, cookie)
	return AuthenticateCookie{cookie}, buf
}