...

Package shm

import "github.com/jezek/xgb/shm"
Overview
Index

Overview ▾

Package shm is the X client API for the MIT-SHM extension.

Index ▾

Constants
func BadSegErrorNew(buf []byte) xgb.Error
func CompletionEventNew(buf []byte) xgb.Event
func Init(c *xgb.Conn) error
type AttachCookie
    func Attach(c *xgb.Conn, Shmseg Seg, Shmid uint32, ReadOnly bool) AttachCookie
    func AttachChecked(c *xgb.Conn, Shmseg Seg, Shmid uint32, ReadOnly bool) AttachCookie
    func (cook AttachCookie) Check() error
type AttachFdCookie
    func AttachFd(c *xgb.Conn, Shmseg Seg, ReadOnly bool) AttachFdCookie
    func AttachFdChecked(c *xgb.Conn, Shmseg Seg, ReadOnly bool) AttachFdCookie
    func (cook AttachFdCookie) Check() error
type BadSegError
    func (err BadSegError) BadId() uint32
    func (err BadSegError) Error() string
    func (err BadSegError) SequenceId() uint16
type CompletionEvent
    func (v CompletionEvent) Bytes() []byte
    func (v CompletionEvent) SequenceId() uint16
    func (v CompletionEvent) String() string
type CreatePixmapCookie
    func CreatePixmap(c *xgb.Conn, Pid xproto.Pixmap, Drawable xproto.Drawable, Width uint16, Height uint16, Depth byte, Shmseg Seg, Offset uint32) CreatePixmapCookie
    func CreatePixmapChecked(c *xgb.Conn, Pid xproto.Pixmap, Drawable xproto.Drawable, Width uint16, Height uint16, Depth byte, Shmseg Seg, Offset uint32) CreatePixmapCookie
    func (cook CreatePixmapCookie) Check() error
type CreateSegmentCookie
    func CreateSegment(c *xgb.Conn, Shmseg Seg, Size uint32, ReadOnly bool) CreateSegmentCookie
    func CreateSegmentUnchecked(c *xgb.Conn, Shmseg Seg, Size uint32, ReadOnly bool) CreateSegmentCookie
    func (cook CreateSegmentCookie) Reply() (*CreateSegmentReply, error)
type CreateSegmentReply
type DetachCookie
    func Detach(c *xgb.Conn, Shmseg Seg) DetachCookie
    func DetachChecked(c *xgb.Conn, Shmseg Seg) DetachCookie
    func (cook DetachCookie) Check() error
type GetImageCookie
    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
    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 (cook GetImageCookie) Reply() (*GetImageReply, error)
type GetImageReply
type PutImageCookie
    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 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
    func (cook PutImageCookie) Check() error
type QueryVersionCookie
    func QueryVersion(c *xgb.Conn) QueryVersionCookie
    func QueryVersionUnchecked(c *xgb.Conn) QueryVersionCookie
    func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error)
type QueryVersionReply
type Seg
    func NewSegId(c *xgb.Conn) (Seg, error)

Package files

shm.go

Constants

BadBadSeg is the error number for a BadBadSeg.

const BadBadSeg = 0

Completion is the event number for a CompletionEvent.

const Completion = 0

func BadSegErrorNew

func BadSegErrorNew(buf []byte) xgb.Error

BadSegErrorNew constructs a BadSegError value that implements xgb.Error from a byte slice.

func CompletionEventNew

func CompletionEventNew(buf []byte) xgb.Event

CompletionEventNew constructs a CompletionEvent value that implements xgb.Event from a byte slice.

func Init

func Init(c *xgb.Conn) error

Init must be called before using the MIT-SHM extension.

type AttachCookie

AttachCookie is a cookie used only for Attach requests.

type AttachCookie struct {
    *xgb.Cookie
}

func Attach

func Attach(c *xgb.Conn, Shmseg Seg, Shmid uint32, ReadOnly bool) AttachCookie

Attach sends an unchecked request. If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.

func AttachChecked

func AttachChecked(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()

func (AttachCookie) Check

func (cook AttachCookie) Check() error

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.

type AttachFdCookie

AttachFdCookie is a cookie used only for AttachFd requests.

type AttachFdCookie struct {
    *xgb.Cookie
}

func AttachFd

func AttachFd(c *xgb.Conn, Shmseg Seg, ReadOnly bool) AttachFdCookie

AttachFd sends an unchecked request. If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.

func AttachFdChecked

func AttachFdChecked(c *xgb.Conn, Shmseg Seg, ReadOnly bool) AttachFdCookie

AttachFdChecked sends a checked request. If an error occurs, it can be retrieved using AttachFdCookie.Check()

func (AttachFdCookie) Check

func (cook AttachFdCookie) Check() error

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.

type BadSegError

type BadSegError xproto.ValueError

func (BadSegError) BadId

func (err BadSegError) BadId() uint32

BadId returns the 'BadValue' number if one exists for the BadBadSeg error. If no bad value exists, 0 is returned.

func (BadSegError) Error

func (err BadSegError) Error() string

Error returns a rudimentary string representation of the BadBadSeg error.

func (BadSegError) SequenceId

func (err BadSegError) SequenceId() uint16

SequenceId returns the sequence id attached to the BadBadSeg error. This is mostly used internally.

type CompletionEvent

type CompletionEvent struct {
    Sequence uint16
    // padding: 1 bytes
    Drawable   xproto.Drawable
    MinorEvent uint16
    MajorEvent byte
    // padding: 1 bytes
    Shmseg Seg
    Offset uint32
}

func (CompletionEvent) Bytes

func (v CompletionEvent) Bytes() []byte

Bytes writes a CompletionEvent value to a byte slice.

func (CompletionEvent) SequenceId

func (v CompletionEvent) SequenceId() uint16

SequenceId returns the sequence id attached to the Completion event. Events without a sequence number (KeymapNotify) return 0. This is mostly used internally.

func (CompletionEvent) String

func (v CompletionEvent) String() string

String is a rudimentary string representation of CompletionEvent.

type CreatePixmapCookie

CreatePixmapCookie is a cookie used only for CreatePixmap requests.

type CreatePixmapCookie struct {
    *xgb.Cookie
}

func CreatePixmap

func CreatePixmap(c *xgb.Conn, Pid xproto.Pixmap, Drawable xproto.Drawable, Width uint16, Height uint16, Depth byte, Shmseg Seg, Offset uint32) CreatePixmapCookie

CreatePixmap sends an unchecked request. If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.

func CreatePixmapChecked

func CreatePixmapChecked(c *xgb.Conn, Pid xproto.Pixmap, Drawable xproto.Drawable, Width uint16, Height uint16, Depth byte, Shmseg Seg, Offset uint32) CreatePixmapCookie

CreatePixmapChecked sends a checked request. If an error occurs, it can be retrieved using CreatePixmapCookie.Check()

func (CreatePixmapCookie) Check

func (cook CreatePixmapCookie) Check() error

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.

type CreateSegmentCookie

CreateSegmentCookie is a cookie used only for CreateSegment requests.

type CreateSegmentCookie struct {
    *xgb.Cookie
}

func CreateSegment

func CreateSegment(c *xgb.Conn, Shmseg Seg, Size uint32, ReadOnly bool) CreateSegmentCookie

CreateSegment sends a checked request. If an error occurs, it will be returned with the reply by calling CreateSegmentCookie.Reply()

func CreateSegmentUnchecked

func CreateSegmentUnchecked(c *xgb.Conn, Shmseg Seg, Size uint32, ReadOnly bool) CreateSegmentCookie

CreateSegmentUnchecked sends an unchecked request. If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.

func (CreateSegmentCookie) Reply

func (cook CreateSegmentCookie) Reply() (*CreateSegmentReply, error)

Reply blocks and returns the reply data for a CreateSegment request.

type CreateSegmentReply

CreateSegmentReply represents the data returned from a CreateSegment request.

type CreateSegmentReply struct {
    Sequence uint16 // sequence number of the request for this reply
    Length   uint32 // number of bytes in this reply
    Nfd      byte
}

type DetachCookie

DetachCookie is a cookie used only for Detach requests.

type DetachCookie struct {
    *xgb.Cookie
}

func Detach

func Detach(c *xgb.Conn, Shmseg Seg) DetachCookie

Detach sends an unchecked request. If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.

func DetachChecked

func DetachChecked(c *xgb.Conn, Shmseg Seg) DetachCookie

DetachChecked sends a checked request. If an error occurs, it can be retrieved using DetachCookie.Check()

func (DetachCookie) Check

func (cook DetachCookie) Check() error

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.

type GetImageCookie

GetImageCookie is a cookie used only for GetImage requests.

type GetImageCookie struct {
    *xgb.Cookie
}

func GetImage

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

GetImage sends a checked request. If an error occurs, it will be returned with the reply by calling GetImageCookie.Reply()

func GetImageUnchecked

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

GetImageUnchecked sends an unchecked request. If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.

func (GetImageCookie) Reply

func (cook GetImageCookie) Reply() (*GetImageReply, error)

Reply blocks and returns the reply data for a GetImage request.

type GetImageReply

GetImageReply represents the data returned from a GetImage request.

type GetImageReply struct {
    Sequence uint16 // sequence number of the request for this reply
    Length   uint32 // number of bytes in this reply
    Depth    byte
    Visual   xproto.Visualid
    Size     uint32
}

type PutImageCookie

PutImageCookie is a cookie used only for PutImage requests.

type PutImageCookie struct {
    *xgb.Cookie
}

func PutImage

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

PutImage sends an unchecked request. If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.

func PutImageChecked

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

PutImageChecked sends a checked request. If an error occurs, it can be retrieved using PutImageCookie.Check()

func (PutImageCookie) Check

func (cook PutImageCookie) Check() error

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.

type QueryVersionCookie

QueryVersionCookie is a cookie used only for QueryVersion requests.

type QueryVersionCookie struct {
    *xgb.Cookie
}

func QueryVersion

func QueryVersion(c *xgb.Conn) QueryVersionCookie

QueryVersion sends a checked request. If an error occurs, it will be returned with the reply by calling QueryVersionCookie.Reply()

func QueryVersionUnchecked

func QueryVersionUnchecked(c *xgb.Conn) QueryVersionCookie

QueryVersionUnchecked sends an unchecked request. If an error occurs, it can only be retrieved using xgb.WaitForEvent or xgb.PollForEvent.

func (QueryVersionCookie) Reply

func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error)

Reply blocks and returns the reply data for a QueryVersion request.

type QueryVersionReply

QueryVersionReply represents the data returned from a QueryVersion request.

type QueryVersionReply struct {
    Sequence      uint16 // sequence number of the request for this reply
    Length        uint32 // number of bytes in this reply
    SharedPixmaps bool
    MajorVersion  uint16
    MinorVersion  uint16
    Uid           uint16
    Gid           uint16
    PixmapFormat  byte
}

type Seg

type Seg uint32

func NewSegId

func NewSegId(c *xgb.Conn) (Seg, error)