aboutsummaryrefslogtreecommitdiff
path: root/nexgb/shm/shm.go
diff options
context:
space:
mode:
Diffstat (limited to 'nexgb/shm/shm.go')
-rw-r--r--nexgb/shm/shm.go58
1 files changed, 25 insertions, 33 deletions
diff --git a/nexgb/shm/shm.go b/nexgb/shm/shm.go
index 36fd043..79e12d4 100644
--- a/nexgb/shm/shm.go
+++ b/nexgb/shm/shm.go
@@ -232,7 +232,7 @@ func Attach(c *xgb.Conn, Shmseg Seg, Shmid uint32, ReadOnly bool) AttachCookie {
}
// AttachChecked sends a checked request.
-// If an error occurs, it can be retrieved using AttachCookie.Check()
+// If an error occurs, it can be retrieved using AttachCookie.Check.
func AttachChecked(c *xgb.Conn, Shmseg Seg, Shmid uint32, ReadOnly bool) AttachCookie {
c.ExtLock.RLock()
defer c.ExtLock.RUnlock()
@@ -250,8 +250,7 @@ func (cook AttachCookie) Check() error {
return cook.Cookie.Check()
}
-// Write request to wire for Attach
-// attachRequest writes a Attach request to a byte slice.
+// attachRequest writes a Attach request to a byte slice for transfer.
func attachRequest(c *xgb.Conn, Shmseg Seg, Shmid uint32, ReadOnly bool) []byte {
size := 16
b := 0
@@ -305,7 +304,7 @@ func AttachFd(c *xgb.Conn, Shmseg Seg, ReadOnly bool) AttachFdCookie {
}
// AttachFdChecked sends a checked request.
-// If an error occurs, it can be retrieved using AttachFdCookie.Check()
+// If an error occurs, it can be retrieved using AttachFdCookie.Check.
func AttachFdChecked(c *xgb.Conn, Shmseg Seg, ReadOnly bool) AttachFdCookie {
c.ExtLock.RLock()
defer c.ExtLock.RUnlock()
@@ -323,8 +322,7 @@ func (cook AttachFdCookie) Check() error {
return cook.Cookie.Check()
}
-// Write request to wire for AttachFd
-// attachFdRequest writes a AttachFd request to a byte slice.
+// attachFdRequest writes a AttachFd request to a byte slice for transfer.
func attachFdRequest(c *xgb.Conn, Shmseg Seg, ReadOnly bool) []byte {
size := 12
b := 0
@@ -363,7 +361,7 @@ type CreatePixmapCookie struct {
// CreatePixmap sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
-func CreatePixmap(c *xgb.Conn, Pid xproto.Pixmap, Drawable xproto.Drawable, Width uint16, Height uint16, Depth byte, Shmseg Seg, Offset uint32) CreatePixmapCookie {
+func CreatePixmap(c *xgb.Conn, Pid xproto.Pixmap, Drawable xproto.Drawable, Width, Height uint16, Depth byte, Shmseg Seg, Offset uint32) CreatePixmapCookie {
c.ExtLock.RLock()
defer c.ExtLock.RUnlock()
if _, ok := c.Extensions["MIT-SHM"]; !ok {
@@ -375,8 +373,8 @@ func CreatePixmap(c *xgb.Conn, Pid xproto.Pixmap, Drawable xproto.Drawable, Widt
}
// CreatePixmapChecked sends a checked request.
-// If an error occurs, it can be retrieved using CreatePixmapCookie.Check()
-func CreatePixmapChecked(c *xgb.Conn, Pid xproto.Pixmap, Drawable xproto.Drawable, Width uint16, Height uint16, Depth byte, Shmseg Seg, Offset uint32) CreatePixmapCookie {
+// If an error occurs, it can be retrieved using CreatePixmapCookie.Check.
+func CreatePixmapChecked(c *xgb.Conn, Pid xproto.Pixmap, Drawable xproto.Drawable, Width, Height uint16, Depth byte, Shmseg Seg, Offset uint32) CreatePixmapCookie {
c.ExtLock.RLock()
defer c.ExtLock.RUnlock()
if _, ok := c.Extensions["MIT-SHM"]; !ok {
@@ -393,9 +391,8 @@ func (cook CreatePixmapCookie) Check() error {
return cook.Cookie.Check()
}
-// Write request to wire for CreatePixmap
-// createPixmapRequest writes a CreatePixmap request to a byte slice.
-func createPixmapRequest(c *xgb.Conn, Pid xproto.Pixmap, Drawable xproto.Drawable, Width uint16, Height uint16, Depth byte, Shmseg Seg, Offset uint32) []byte {
+// createPixmapRequest writes a CreatePixmap request to a byte slice for transfer.
+func createPixmapRequest(c *xgb.Conn, Pid xproto.Pixmap, Drawable xproto.Drawable, Width, Height uint16, Depth byte, Shmseg Seg, Offset uint32) []byte {
size := 28
b := 0
buf := make([]byte, size)
@@ -443,7 +440,7 @@ type CreateSegmentCookie struct {
}
// CreateSegment sends a checked request.
-// If an error occurs, it will be returned with the reply by calling CreateSegmentCookie.Reply()
+// If an error occurs, it will be returned with the reply by calling CreateSegmentCookie.Reply.
func CreateSegment(c *xgb.Conn, Shmseg Seg, Size uint32, ReadOnly bool) CreateSegmentCookie {
c.ExtLock.RLock()
defer c.ExtLock.RUnlock()
@@ -507,8 +504,7 @@ func createSegmentReply(buf []byte) *CreateSegmentReply {
return v
}
-// Write request to wire for CreateSegment
-// createSegmentRequest writes a CreateSegment request to a byte slice.
+// createSegmentRequest writes a CreateSegment request to a byte slice for transfer.
func createSegmentRequest(c *xgb.Conn, Shmseg Seg, Size uint32, ReadOnly bool) []byte {
size := 16
b := 0
@@ -562,7 +558,7 @@ func Detach(c *xgb.Conn, Shmseg Seg) DetachCookie {
}
// DetachChecked sends a checked request.
-// If an error occurs, it can be retrieved using DetachCookie.Check()
+// If an error occurs, it can be retrieved using DetachCookie.Check.
func DetachChecked(c *xgb.Conn, Shmseg Seg) DetachCookie {
c.ExtLock.RLock()
defer c.ExtLock.RUnlock()
@@ -580,8 +576,7 @@ func (cook DetachCookie) Check() error {
return cook.Cookie.Check()
}
-// Write request to wire for Detach
-// detachRequest writes a Detach request to a byte slice.
+// detachRequest writes a Detach request to a byte slice for transfer.
func detachRequest(c *xgb.Conn, Shmseg Seg) []byte {
size := 8
b := 0
@@ -610,8 +605,8 @@ type GetImageCookie struct {
}
// GetImage sends a checked request.
-// If an error occurs, it will be returned with the reply by calling GetImageCookie.Reply()
-func GetImage(c *xgb.Conn, Drawable xproto.Drawable, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32, Format byte, Shmseg Seg, Offset uint32) GetImageCookie {
+// If an error occurs, it will be returned with the reply by calling GetImageCookie.Reply.
+func GetImage(c *xgb.Conn, Drawable xproto.Drawable, X, Y int16, Width, Height uint16, PlaneMask uint32, Format byte, Shmseg Seg, Offset uint32) GetImageCookie {
c.ExtLock.RLock()
defer c.ExtLock.RUnlock()
if _, ok := c.Extensions["MIT-SHM"]; !ok {
@@ -624,7 +619,7 @@ func GetImage(c *xgb.Conn, Drawable xproto.Drawable, X int16, Y int16, Width uin
// 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, Drawable xproto.Drawable, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32, Format byte, Shmseg Seg, Offset uint32) GetImageCookie {
+func GetImageUnchecked(c *xgb.Conn, Drawable xproto.Drawable, X, Y int16, Width, Height uint16, PlaneMask uint32, Format byte, Shmseg Seg, Offset uint32) GetImageCookie {
c.ExtLock.RLock()
defer c.ExtLock.RUnlock()
if _, ok := c.Extensions["MIT-SHM"]; !ok {
@@ -679,9 +674,8 @@ func getImageReply(buf []byte) *GetImageReply {
return v
}
-// Write request to wire for GetImage
-// getImageRequest writes a GetImage request to a byte slice.
-func getImageRequest(c *xgb.Conn, Drawable xproto.Drawable, X int16, Y int16, Width uint16, Height uint16, PlaneMask uint32, Format byte, Shmseg Seg, Offset uint32) []byte {
+// getImageRequest writes a GetImage request to a byte slice for transfer.
+func getImageRequest(c *xgb.Conn, Drawable xproto.Drawable, X, Y int16, Width, Height uint16, PlaneMask uint32, Format byte, Shmseg Seg, Offset uint32) []byte {
size := 32
b := 0
buf := make([]byte, size)
@@ -736,7 +730,7 @@ type PutImageCookie struct {
// PutImage sends an unchecked request.
// If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.
-func PutImage(c *xgb.Conn, 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 {
+func PutImage(c *xgb.Conn, Drawable xproto.Drawable, Gc xproto.Gcontext, TotalWidth, TotalHeight, SrcX, SrcY, SrcWidth, SrcHeight uint16, DstX, DstY int16, Depth, Format, SendEvent byte, Shmseg Seg, Offset uint32) PutImageCookie {
c.ExtLock.RLock()
defer c.ExtLock.RUnlock()
if _, ok := c.Extensions["MIT-SHM"]; !ok {
@@ -748,8 +742,8 @@ func PutImage(c *xgb.Conn, Drawable xproto.Drawable, Gc xproto.Gcontext, TotalWi
}
// PutImageChecked sends a checked request.
-// If an error occurs, it can be retrieved using PutImageCookie.Check()
-func PutImageChecked(c *xgb.Conn, 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 {
+// If an error occurs, it can be retrieved using PutImageCookie.Check.
+func PutImageChecked(c *xgb.Conn, Drawable xproto.Drawable, Gc xproto.Gcontext, TotalWidth, TotalHeight, SrcX, SrcY, SrcWidth, SrcHeight uint16, DstX, DstY int16, Depth, Format, SendEvent byte, Shmseg Seg, Offset uint32) PutImageCookie {
c.ExtLock.RLock()
defer c.ExtLock.RUnlock()
if _, ok := c.Extensions["MIT-SHM"]; !ok {
@@ -766,9 +760,8 @@ func (cook PutImageCookie) Check() error {
return cook.Cookie.Check()
}
-// Write request to wire for PutImage
-// putImageRequest writes a PutImage request to a byte slice.
-func putImageRequest(c *xgb.Conn, 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) []byte {
+// putImageRequest writes a PutImage request to a byte slice for transfer.
+func putImageRequest(c *xgb.Conn, Drawable xproto.Drawable, Gc xproto.Gcontext, TotalWidth, TotalHeight, SrcX, SrcY, SrcWidth, SrcHeight uint16, DstX, DstY int16, Depth, Format, SendEvent byte, Shmseg Seg, Offset uint32) []byte {
size := 40
b := 0
buf := make([]byte, size)
@@ -840,7 +833,7 @@ type QueryVersionCookie struct {
}
// QueryVersion sends a checked request.
-// If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply()
+// If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply.
func QueryVersion(c *xgb.Conn) QueryVersionCookie {
c.ExtLock.RLock()
defer c.ExtLock.RUnlock()
@@ -928,8 +921,7 @@ func queryVersionReply(buf []byte) *QueryVersionReply {
return v
}
-// Write request to wire for QueryVersion
-// queryVersionRequest writes a QueryVersion request to a byte slice.
+// queryVersionRequest writes a QueryVersion request to a byte slice for transfer.
func queryVersionRequest(c *xgb.Conn) []byte {
size := 4
b := 0