...

Package shape

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

Overview ▾

Package shape is the X client API for the SHAPE extension.

Index ▾

Constants
func Init(c *xgb.Conn) error
func NotifyEventNew(buf []byte) xgb.Event
type CombineCookie
    func Combine(c *xgb.Conn, Operation Op, DestinationKind Kind, SourceKind Kind, DestinationWindow xproto.Window, XOffset int16, YOffset int16, SourceWindow xproto.Window) CombineCookie
    func CombineChecked(c *xgb.Conn, Operation Op, DestinationKind Kind, SourceKind Kind, DestinationWindow xproto.Window, XOffset int16, YOffset int16, SourceWindow xproto.Window) CombineCookie
    func (cook CombineCookie) Check() error
type GetRectanglesCookie
    func GetRectangles(c *xgb.Conn, Window xproto.Window, SourceKind Kind) GetRectanglesCookie
    func GetRectanglesUnchecked(c *xgb.Conn, Window xproto.Window, SourceKind Kind) GetRectanglesCookie
    func (cook GetRectanglesCookie) Reply() (*GetRectanglesReply, error)
type GetRectanglesReply
type InputSelectedCookie
    func InputSelected(c *xgb.Conn, DestinationWindow xproto.Window) InputSelectedCookie
    func InputSelectedUnchecked(c *xgb.Conn, DestinationWindow xproto.Window) InputSelectedCookie
    func (cook InputSelectedCookie) Reply() (*InputSelectedReply, error)
type InputSelectedReply
type Kind
type MaskCookie
    func Mask(c *xgb.Conn, Operation Op, DestinationKind Kind, DestinationWindow xproto.Window, XOffset int16, YOffset int16, SourceBitmap xproto.Pixmap) MaskCookie
    func MaskChecked(c *xgb.Conn, Operation Op, DestinationKind Kind, DestinationWindow xproto.Window, XOffset int16, YOffset int16, SourceBitmap xproto.Pixmap) MaskCookie
    func (cook MaskCookie) Check() error
type NotifyEvent
    func (v NotifyEvent) Bytes() []byte
    func (v NotifyEvent) SequenceId() uint16
    func (v NotifyEvent) String() string
type OffsetCookie
    func Offset(c *xgb.Conn, DestinationKind Kind, DestinationWindow xproto.Window, XOffset int16, YOffset int16) OffsetCookie
    func OffsetChecked(c *xgb.Conn, DestinationKind Kind, DestinationWindow xproto.Window, XOffset int16, YOffset int16) OffsetCookie
    func (cook OffsetCookie) Check() error
type Op
type QueryExtentsCookie
    func QueryExtents(c *xgb.Conn, DestinationWindow xproto.Window) QueryExtentsCookie
    func QueryExtentsUnchecked(c *xgb.Conn, DestinationWindow xproto.Window) QueryExtentsCookie
    func (cook QueryExtentsCookie) Reply() (*QueryExtentsReply, error)
type QueryExtentsReply
type QueryVersionCookie
    func QueryVersion(c *xgb.Conn) QueryVersionCookie
    func QueryVersionUnchecked(c *xgb.Conn) QueryVersionCookie
    func (cook QueryVersionCookie) Reply() (*QueryVersionReply, error)
type QueryVersionReply
type RectanglesCookie
    func Rectangles(c *xgb.Conn, Operation Op, DestinationKind Kind, Ordering byte, DestinationWindow xproto.Window, XOffset int16, YOffset int16, Rectangles []xproto.Rectangle) RectanglesCookie
    func RectanglesChecked(c *xgb.Conn, Operation Op, DestinationKind Kind, Ordering byte, DestinationWindow xproto.Window, XOffset int16, YOffset int16, Rectangles []xproto.Rectangle) RectanglesCookie
    func (cook RectanglesCookie) Check() error
type SelectInputCookie
    func SelectInput(c *xgb.Conn, DestinationWindow xproto.Window, Enable bool) SelectInputCookie
    func SelectInputChecked(c *xgb.Conn, DestinationWindow xproto.Window, Enable bool) SelectInputCookie
    func (cook SelectInputCookie) Check() error

Package files

shape.go

Constants

const (
    SkBounding = 0
    SkClip     = 1
    SkInput    = 2
)
const (
    SoSet       = 0
    SoUnion     = 1
    SoIntersect = 2
    SoSubtract  = 3
    SoInvert    = 4
)

Notify is the event number for a NotifyEvent.

const Notify = 0

func Init

func Init(c *xgb.Conn) error

Init must be called before using the SHAPE extension.

func NotifyEventNew

func NotifyEventNew(buf []byte) xgb.Event

NotifyEventNew constructs a NotifyEvent value that implements xgb.Event from a byte slice.

type CombineCookie

CombineCookie is a cookie used only for Combine requests.

type CombineCookie struct {
    *xgb.Cookie
}

func Combine

func Combine(c *xgb.Conn, Operation Op, DestinationKind Kind, SourceKind Kind, DestinationWindow xproto.Window, XOffset int16, YOffset int16, SourceWindow xproto.Window) CombineCookie

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

func CombineChecked

func CombineChecked(c *xgb.Conn, Operation Op, DestinationKind Kind, SourceKind Kind, DestinationWindow xproto.Window, XOffset int16, YOffset int16, SourceWindow xproto.Window) CombineCookie

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

func (CombineCookie) Check

func (cook CombineCookie) 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 GetRectanglesCookie

GetRectanglesCookie is a cookie used only for GetRectangles requests.

type GetRectanglesCookie struct {
    *xgb.Cookie
}

func GetRectangles

func GetRectangles(c *xgb.Conn, Window xproto.Window, SourceKind Kind) GetRectanglesCookie

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

func GetRectanglesUnchecked

func GetRectanglesUnchecked(c *xgb.Conn, Window xproto.Window, SourceKind Kind) GetRectanglesCookie

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

func (GetRectanglesCookie) Reply

func (cook GetRectanglesCookie) Reply() (*GetRectanglesReply, error)

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

type GetRectanglesReply

GetRectanglesReply represents the data returned from a GetRectangles request.

type GetRectanglesReply struct {
    Sequence      uint16 // sequence number of the request for this reply
    Length        uint32 // number of bytes in this reply
    Ordering      byte
    RectanglesLen uint32
    // padding: 20 bytes
    Rectangles []xproto.Rectangle // size: xgb.Pad((int(RectanglesLen) * 8))
}

type InputSelectedCookie

InputSelectedCookie is a cookie used only for InputSelected requests.

type InputSelectedCookie struct {
    *xgb.Cookie
}

func InputSelected

func InputSelected(c *xgb.Conn, DestinationWindow xproto.Window) InputSelectedCookie

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

func InputSelectedUnchecked

func InputSelectedUnchecked(c *xgb.Conn, DestinationWindow xproto.Window) InputSelectedCookie

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

func (InputSelectedCookie) Reply

func (cook InputSelectedCookie) Reply() (*InputSelectedReply, error)

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

type InputSelectedReply

InputSelectedReply represents the data returned from a InputSelected request.

type InputSelectedReply struct {
    Sequence uint16 // sequence number of the request for this reply
    Length   uint32 // number of bytes in this reply
    Enabled  bool
}

type Kind

type Kind byte

type MaskCookie

MaskCookie is a cookie used only for Mask requests.

type MaskCookie struct {
    *xgb.Cookie
}

func Mask

func Mask(c *xgb.Conn, Operation Op, DestinationKind Kind, DestinationWindow xproto.Window, XOffset int16, YOffset int16, SourceBitmap xproto.Pixmap) MaskCookie

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

func MaskChecked

func MaskChecked(c *xgb.Conn, Operation Op, DestinationKind Kind, DestinationWindow xproto.Window, XOffset int16, YOffset int16, SourceBitmap xproto.Pixmap) MaskCookie

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

func (MaskCookie) Check

func (cook MaskCookie) 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 NotifyEvent

type NotifyEvent struct {
    Sequence       uint16
    ShapeKind      Kind
    AffectedWindow xproto.Window
    ExtentsX       int16
    ExtentsY       int16
    ExtentsWidth   uint16
    ExtentsHeight  uint16
    ServerTime     xproto.Timestamp
    Shaped         bool
}

func (NotifyEvent) Bytes

func (v NotifyEvent) Bytes() []byte

Bytes writes a NotifyEvent value to a byte slice.

func (NotifyEvent) SequenceId

func (v NotifyEvent) SequenceId() uint16

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

func (NotifyEvent) String

func (v NotifyEvent) String() string

String is a rudimentary string representation of NotifyEvent.

type OffsetCookie

OffsetCookie is a cookie used only for Offset requests.

type OffsetCookie struct {
    *xgb.Cookie
}

func Offset

func Offset(c *xgb.Conn, DestinationKind Kind, DestinationWindow xproto.Window, XOffset int16, YOffset int16) OffsetCookie

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

func OffsetChecked

func OffsetChecked(c *xgb.Conn, DestinationKind Kind, DestinationWindow xproto.Window, XOffset int16, YOffset int16) OffsetCookie

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

func (OffsetCookie) Check

func (cook OffsetCookie) 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 Op

type Op byte

type QueryExtentsCookie

QueryExtentsCookie is a cookie used only for QueryExtents requests.

type QueryExtentsCookie struct {
    *xgb.Cookie
}

func QueryExtents

func QueryExtents(c *xgb.Conn, DestinationWindow xproto.Window) QueryExtentsCookie

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

func QueryExtentsUnchecked

func QueryExtentsUnchecked(c *xgb.Conn, DestinationWindow xproto.Window) QueryExtentsCookie

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

func (QueryExtentsCookie) Reply

func (cook QueryExtentsCookie) Reply() (*QueryExtentsReply, error)

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

type QueryExtentsReply

QueryExtentsReply represents the data returned from a QueryExtents request.

type QueryExtentsReply struct {
    Sequence uint16 // sequence number of the request for this reply
    Length   uint32 // number of bytes in this reply
    // padding: 1 bytes
    BoundingShaped bool
    ClipShaped     bool
    // padding: 2 bytes
    BoundingShapeExtentsX      int16
    BoundingShapeExtentsY      int16
    BoundingShapeExtentsWidth  uint16
    BoundingShapeExtentsHeight uint16
    ClipShapeExtentsX          int16
    ClipShapeExtentsY          int16
    ClipShapeExtentsWidth      uint16
    ClipShapeExtentsHeight     uint16
}

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
    // padding: 1 bytes
    MajorVersion uint16
    MinorVersion uint16
}

type RectanglesCookie

RectanglesCookie is a cookie used only for Rectangles requests.

type RectanglesCookie struct {
    *xgb.Cookie
}

func Rectangles

func Rectangles(c *xgb.Conn, Operation Op, DestinationKind Kind, Ordering byte, DestinationWindow xproto.Window, XOffset int16, YOffset int16, Rectangles []xproto.Rectangle) RectanglesCookie

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

func RectanglesChecked

func RectanglesChecked(c *xgb.Conn, Operation Op, DestinationKind Kind, Ordering byte, DestinationWindow xproto.Window, XOffset int16, YOffset int16, Rectangles []xproto.Rectangle) RectanglesCookie

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

func (RectanglesCookie) Check

func (cook RectanglesCookie) 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 SelectInputCookie

SelectInputCookie is a cookie used only for SelectInput requests.

type SelectInputCookie struct {
    *xgb.Cookie
}

func SelectInput

func SelectInput(c *xgb.Conn, DestinationWindow xproto.Window, Enable bool) SelectInputCookie

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

func SelectInputChecked

func SelectInputChecked(c *xgb.Conn, DestinationWindow xproto.Window, Enable bool) SelectInputCookie

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

func (SelectInputCookie) Check

func (cook SelectInputCookie) 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.