Documentation ¶
Overview ¶
Package window implements a convenient wayland windowing
Index ¶
- Constants
- func DisplayRun(Display *Display)
- func SurfaceEnter(wlSurface *wl.Surface, wlOutput *wl.Output)
- func SurfaceLeave(wlSurface *wl.Surface, wlOutput *wl.Output)
- type CloseHandler
- type DataHandler
- type DataSource
- type Display
- func (d *Display) CreateDataSource() (*DataSource, error)
- func (d *Display) Destroy()
- func (d *Display) Exit()
- func (d *Display) GetSerial() uint32
- func (d *Display) HandleRegistryGlobal(e wl.RegistryGlobalEvent)
- func (d *Display) HandleRegistryGlobalRemove(e wl.RegistryGlobalRemoveEvent)
- func (d *Display) HandleShmFormat(e wl.ShmFormatEvent)
- func (d *Display) HandleWmBasePing(ev zxdg.WmBasePingEvent)
- func (d *Display) RegistryGlobal(registry *wl.Registry, id uint32, iface string, version uint32)
- func (d *Display) RegistryGlobalRemove(wlRegistry *wl.Registry, name uint32)
- func (d *Display) SetGlobalHandler(gh GlobalHandler)
- func (d *Display) SetSeatHandler(h SeatHandler)
- func (d *Display) SetUserData(data interface{})
- func (d *Display) ShellPing(shell *zxdg.WmBase, serial uint32)
- func (d *Display) ShmFormat(wlShm *wl.Shm, format uint32)
- type FullscreenHandler
- type GlobalHandler
- type Input
- func (input *Input) CallbackDone(wlCallback *wl.Callback, callbackData uint32)
- func (input *Input) Destroy()
- func (input *Input) DeviceSetSelection(src *DataSource, serial uint32)
- func (input *Input) GetModifiers() ModType
- func (input *Input) GetRune(sym *uint32, _ uint32) (r rune)
- func (input *Input) GetUtf8() []byte
- func (input *Input) HandleCallbackDone(ev wl.CallbackDoneEvent)
- func (input *Input) HandleDataDeviceDataOffer(ev wl.DataDeviceDataOfferEvent)
- func (input *Input) HandleDataDeviceDrop(ev wl.DataDeviceDropEvent)
- func (input *Input) HandleDataDeviceEnter(ev wl.DataDeviceEnterEvent)
- func (input *Input) HandleDataDeviceLeave(ev wl.DataDeviceLeaveEvent)
- func (input *Input) HandleDataDeviceMotion(ev wl.DataDeviceMotionEvent)
- func (input *Input) HandleDataDeviceSelection(ev wl.DataDeviceSelectionEvent)
- func (input *Input) HandleKeyboardEnter(e wl.KeyboardEnterEvent)
- func (input *Input) HandleKeyboardKey(e wl.KeyboardKeyEvent)
- func (input *Input) HandleKeyboardKeymap(e wl.KeyboardKeymapEvent)
- func (input *Input) HandleKeyboardLeave(e wl.KeyboardLeaveEvent)
- func (input *Input) HandleKeyboardModifiers(e wl.KeyboardModifiersEvent)
- func (input *Input) HandleKeyboardRepeatInfo(e wl.KeyboardRepeatInfoEvent)
- func (input *Input) HandlePointerAxis(ev wl.PointerAxisEvent)
- func (input *Input) HandlePointerAxisDiscrete(ev wl.PointerAxisDiscreteEvent)
- func (input *Input) HandlePointerAxisSource(ev wl.PointerAxisSourceEvent)
- func (input *Input) HandlePointerAxisStop(ev wl.PointerAxisStopEvent)
- func (input *Input) HandlePointerButton(ev wl.PointerButtonEvent)
- func (input *Input) HandlePointerEnter(ev wl.PointerEnterEvent)
- func (input *Input) HandlePointerFrame(ev wl.PointerFrameEvent)
- func (input *Input) HandlePointerLeave(ev wl.PointerLeaveEvent)
- func (input *Input) HandlePointerMotion(ev wl.PointerMotionEvent)
- func (input *Input) HandleSeatCapabilities(ev wl.SeatCapabilitiesEvent)
- func (input *Input) HandleSeatName(ev wl.SeatNameEvent)
- func (input *Input) HandleTouchCancel(e wl.TouchCancelEvent)
- func (input *Input) HandleTouchDown(e wl.TouchDownEvent)
- func (input *Input) HandleTouchFrame(e wl.TouchFrameEvent)
- func (input *Input) HandleTouchMotion(e wl.TouchMotionEvent)
- func (input *Input) HandleTouchOrientation(e wl.TouchOrientationEvent)
- func (input *Input) HandleTouchShape(e wl.TouchShapeEvent)
- func (input *Input) HandleTouchUp(e wl.TouchUpEvent)
- func (input *Input) PointerAxis(wlPointer *wl.Pointer, time uint32, axis uint32, value float32)
- func (input *Input) PointerAxisDiscrete(wlPointer *wl.Pointer, axis uint32, discrete int32)
- func (input *Input) PointerAxisSource(wlPointer *wl.Pointer, axisSource uint32)
- func (input *Input) PointerAxisStop(wlPointer *wl.Pointer, time uint32, axis uint32)
- func (input *Input) PointerButton(wlPointer *wl.Pointer, serial uint32, time uint32, button uint32, ...)
- func (input *Input) PointerEnter(wlPointer *wl.Pointer, serial uint32, surface *wl.Surface, sx float32, ...)
- func (input *Input) PointerFrame(wlPointer *wl.Pointer)
- func (input *Input) PointerLeave(wlPointer *wl.Pointer, serial uint32, wlSurface *wl.Surface)
- func (input *Input) PointerMotion(wlPointer *wl.Pointer, time uint32, surfaceX float32, surfaceY float32)
- func (input *Input) ReceiveSelectionData(mimeType string, function io.WriteCloser) error
- func (input *Input) SeatCapabilities(seat *wl.Seat, caps uint32)
- func (input *Input) SeatName(wlSeat *wl.Seat, name string)
- type KeyboardHandler
- type ModType
- type Popup
- func (w *Popup) BufferRelease(buffer *wl.Buffer)
- func (w *Popup) Destroy()
- func (w *Popup) HandleBufferRelease(ev wl.BufferReleaseEvent)
- func (w *Popup) HandleCallbackDone(ev wl.CallbackDoneEvent)
- func (w *Popup) HandlePopupConfigure(ev zxdg.PopupConfigureEvent)
- func (w *Popup) HandlePopupPopupDone(ev zxdg.PopupPopupDoneEvent)
- func (w *Popup) HandleSurfaceConfigure(ev zxdg.SurfaceConfigureEvent)
- func (w *Popup) PopupConfigure(x, y, width, height int32)
- func (p *Popup) PopupGetSurface() cairo.Surface
- func (w *Popup) PopupPopupDone()
- func (p *Popup) SetPopupHandler(ph Popuper)
- func (w *Popup) SurfaceConfigure(serial uint32)
- type Popuper
- type Rectangle
- type ResizeHandler
- type SeatHandler
- type Widget
- func (parent *Widget) AddWidget(data WidgetHandler) *Widget
- func (parent *Widget) Destroy()
- func (widget *Widget) GetAllocation() Rectangle
- func (parent *Widget) ScheduleRedraw()
- func (parent *Widget) ScheduleResize(width int32, height int32)
- func (Widget *Widget) SetAllocation(x int32, y int32, width int32, height int32)
- func (w *Widget) SetUserDataWidgetHandler(wh WidgetHandler)
- func (parent *Widget) WidgetGetLastTime() uint32
- type WidgetHandler
- type Window
- func (Window *Window) AddPopupWidget(p *Popup, data WidgetHandler) *Widget
- func (Window *Window) AddWidget(data WidgetHandler) *Widget
- func (w *Window) CreatePopup(seat *wl.Seat, clickSerial, width, height, x, y uint32) *Popup
- func (Window *Window) Destroy()
- func (Window *Window) FrameCreate(data WidgetHandler) *Widget
- func (Window *Window) HandleSurfaceConfigure(ev zxdg.SurfaceConfigureEvent)
- func (Window *Window) HandleToplevelClose(ev zxdg.ToplevelCloseEvent)
- func (Window *Window) HandleToplevelConfigure(ev zxdg.ToplevelConfigureEvent)
- func (Window *Window) InhibitRedraw()
- func (Window *Window) Run(events uint32)
- func (Window *Window) ScheduleRedraw()
- func (Window *Window) ScheduleResize(width int32, height int32)
- func (Window *Window) SetBufferType(t int32)
- func (Window *Window) SetCloseHandler(handler CloseHandler)
- func (Window *Window) SetDataHandler(window *Window, handler DataHandler)
- func (window *Window) SetFullscreen(fullscreen bool) error
- func (Window *Window) SetFullscreenHandler(handler FullscreenHandler)
- func (Window *Window) SetKeyboardHandler(handler KeyboardHandler)
- func (Window *Window) SetMaximized(maximized bool) error
- func (Window *Window) SetMinimized() error
- func (Window *Window) SetTitle(title string)
- func (Window *Window) SurfaceConfigure(zxdgSurfaceV6 *zxdg.Surface, serial uint32)
- func (Window *Window) ToggleMaximized() error
- func (Window *Window) ToplevelClose(zxdgToplevelV6 *zxdg.Toplevel)
- func (Window *Window) ToplevelConfigure(zxdgToplevelV6 *zxdg.Toplevel, width int32, height int32, states []int32)
- func (Window *Window) UninhibitRedraw()
- func (Window *Window) WindowGetSurface() cairo.Surface
Constants ¶
View Source
const ( TYPE_NONE byte = iota TYPE_TOPLEVEL TYPE_FULLSCREEN TYPE_MAXIMIZED TYPE_TRANSIENT TYPE_MENU TYPE_CUSTOM )
View Source
const BufferTypeEglWindow = 0
View Source
const BufferTypeShm = 1
View Source
const CursorBlank = 16
View Source
const CursorBottom = 2
View Source
const CursorBottomLeft = 0
View Source
const CursorBottomRight = 1
View Source
const CursorDefault = 100
View Source
const CursorDndCopy = 14
View Source
const CursorDndForbidden = 15
View Source
const CursorDndMove = 13
View Source
const CursorDragging = 3
View Source
const CursorHand1 = 11
View Source
const CursorIbeam = 10
View Source
const CursorLeft = 5
View Source
const CursorLeftPtr = 4
View Source
const CursorRight = 6
View Source
const CursorTop = 9
View Source
const CursorTopLeft = 7
View Source
const CursorTopRight = 8
View Source
const CursorUnset = 101
View Source
const CursorWatch = 12
View Source
const FrameButtonAll = FrameButtonClose | FrameButtonMaximize | FrameButtonMinimize
View Source
const FrameButtonClose = 0x1
View Source
const FrameButtonMaximize = 0x2
View Source
const FrameButtonMinimize = 0x4
View Source
const FrameButtonNone = 0
View Source
const FrameFlagActive = 0x1
View Source
const FrameFlagMaximized = 0x2
View Source
const FrameStatusAll = FrameStatusRepaint | FrameStatusMinimize | FrameStatusMaximize | FrameStatusClose | FrameStatusMenu | FrameStatusResize | FrameStatusMove
View Source
const FrameStatusClose = 0x8
View Source
const FrameStatusMaximize = 0x4
View Source
const FrameStatusMenu = 0x10
View Source
const FrameStatusMinimize = 0x2
View Source
const FrameStatusMove = 0x40
View Source
const FrameStatusNone = 0
View Source
const FrameStatusRepaint = 0x1
View Source
const FrameStatusResize = 0x20
View Source
const MaxLeaves = 3
View Source
const PreferredFormatNone = 0
View Source
const PreferredFormatRgb565 = 1
View Source
const SurfaceHintResize = 0x10
View Source
const SurfaceHintRgb565 = 0x100
View Source
const SurfaceOpaque = 0x01
View Source
const SurfaceShm = 0x02
View Source
const ZwpPointerConstraintsV1Version = 1
View Source
const ZwpRelativePointerManagerV1Version = 1
Variables ¶
This section is empty.
Functions ¶
func DisplayRun ¶
func DisplayRun(Display *Display)
Types ¶
type CloseHandler ¶
type CloseHandler interface {
Close()
}
type DataHandler ¶
type DataSource ¶
type DataSource struct { CopyBuffer string // contains filtered or unexported fields }
func (*DataSource) AddListener ¶
func (ds *DataSource) AddListener(l wlclient.DataSourceListener)
func (*DataSource) Offer ¶
func (ds *DataSource) Offer(str string)
func (*DataSource) RemoveListener ¶
func (ds *DataSource) RemoveListener(l wlclient.DataSourceListener)
type Display ¶
func (*Display) CreateDataSource ¶
func (d *Display) CreateDataSource() (*DataSource, error)
func (*Display) HandleRegistryGlobal ¶
func (d *Display) HandleRegistryGlobal(e wl.RegistryGlobalEvent)
func (*Display) HandleRegistryGlobalRemove ¶
func (d *Display) HandleRegistryGlobalRemove(e wl.RegistryGlobalRemoveEvent)
func (*Display) HandleShmFormat ¶
func (d *Display) HandleShmFormat(e wl.ShmFormatEvent)
func (*Display) HandleWmBasePing ¶
func (d *Display) HandleWmBasePing(ev zxdg.WmBasePingEvent)
func (*Display) RegistryGlobal ¶
func (*Display) RegistryGlobalRemove ¶
func (*Display) SetGlobalHandler ¶
func (d *Display) SetGlobalHandler(gh GlobalHandler)
func (*Display) SetSeatHandler ¶
func (d *Display) SetSeatHandler(h SeatHandler)
func (*Display) SetUserData ¶
func (d *Display) SetUserData(data interface{})
type FullscreenHandler ¶
type FullscreenHandler interface {
Fullscreen(*Window, WidgetHandler)
}
type GlobalHandler ¶
type Input ¶
type Input struct { Display *Display // contains filtered or unexported fields }
func (*Input) CallbackDone ¶
func (*Input) DeviceSetSelection ¶
func (input *Input) DeviceSetSelection(src *DataSource, serial uint32)
func (*Input) GetModifiers ¶
func (*Input) HandleCallbackDone ¶
func (input *Input) HandleCallbackDone(ev wl.CallbackDoneEvent)
func (*Input) HandleDataDeviceDataOffer ¶
func (input *Input) HandleDataDeviceDataOffer(ev wl.DataDeviceDataOfferEvent)
func (*Input) HandleDataDeviceDrop ¶
func (input *Input) HandleDataDeviceDrop(ev wl.DataDeviceDropEvent)
func (*Input) HandleDataDeviceEnter ¶
func (input *Input) HandleDataDeviceEnter(ev wl.DataDeviceEnterEvent)
func (*Input) HandleDataDeviceLeave ¶
func (input *Input) HandleDataDeviceLeave(ev wl.DataDeviceLeaveEvent)
func (*Input) HandleDataDeviceMotion ¶
func (input *Input) HandleDataDeviceMotion(ev wl.DataDeviceMotionEvent)
func (*Input) HandleDataDeviceSelection ¶
func (input *Input) HandleDataDeviceSelection(ev wl.DataDeviceSelectionEvent)
func (*Input) HandleKeyboardEnter ¶
func (input *Input) HandleKeyboardEnter(e wl.KeyboardEnterEvent)
func (*Input) HandleKeyboardKey ¶
func (input *Input) HandleKeyboardKey(e wl.KeyboardKeyEvent)
func (*Input) HandleKeyboardKeymap ¶
func (input *Input) HandleKeyboardKeymap(e wl.KeyboardKeymapEvent)
func (*Input) HandleKeyboardLeave ¶
func (input *Input) HandleKeyboardLeave(e wl.KeyboardLeaveEvent)
func (*Input) HandleKeyboardModifiers ¶
func (input *Input) HandleKeyboardModifiers(e wl.KeyboardModifiersEvent)
func (*Input) HandleKeyboardRepeatInfo ¶
func (input *Input) HandleKeyboardRepeatInfo(e wl.KeyboardRepeatInfoEvent)
func (*Input) HandlePointerAxis ¶
func (input *Input) HandlePointerAxis(ev wl.PointerAxisEvent)
func (*Input) HandlePointerAxisDiscrete ¶
func (input *Input) HandlePointerAxisDiscrete(ev wl.PointerAxisDiscreteEvent)
func (*Input) HandlePointerAxisSource ¶
func (input *Input) HandlePointerAxisSource(ev wl.PointerAxisSourceEvent)
func (*Input) HandlePointerAxisStop ¶
func (input *Input) HandlePointerAxisStop(ev wl.PointerAxisStopEvent)
func (*Input) HandlePointerButton ¶
func (input *Input) HandlePointerButton(ev wl.PointerButtonEvent)
func (*Input) HandlePointerEnter ¶
func (input *Input) HandlePointerEnter(ev wl.PointerEnterEvent)
func (*Input) HandlePointerFrame ¶
func (input *Input) HandlePointerFrame(ev wl.PointerFrameEvent)
func (*Input) HandlePointerLeave ¶
func (input *Input) HandlePointerLeave(ev wl.PointerLeaveEvent)
func (*Input) HandlePointerMotion ¶
func (input *Input) HandlePointerMotion(ev wl.PointerMotionEvent)
func (*Input) HandleSeatCapabilities ¶
func (input *Input) HandleSeatCapabilities(ev wl.SeatCapabilitiesEvent)
func (*Input) HandleSeatName ¶
func (input *Input) HandleSeatName(ev wl.SeatNameEvent)
func (*Input) HandleTouchCancel ¶
func (input *Input) HandleTouchCancel(e wl.TouchCancelEvent)
func (*Input) HandleTouchDown ¶
func (input *Input) HandleTouchDown(e wl.TouchDownEvent)
func (*Input) HandleTouchFrame ¶
func (input *Input) HandleTouchFrame(e wl.TouchFrameEvent)
func (*Input) HandleTouchMotion ¶
func (input *Input) HandleTouchMotion(e wl.TouchMotionEvent)
func (*Input) HandleTouchOrientation ¶
func (input *Input) HandleTouchOrientation(e wl.TouchOrientationEvent)
func (*Input) HandleTouchShape ¶
func (input *Input) HandleTouchShape(e wl.TouchShapeEvent)
func (*Input) HandleTouchUp ¶
func (input *Input) HandleTouchUp(e wl.TouchUpEvent)
func (*Input) PointerAxis ¶
func (*Input) PointerAxisDiscrete ¶
func (*Input) PointerAxisSource ¶
func (*Input) PointerAxisStop ¶
func (*Input) PointerButton ¶
func (*Input) PointerEnter ¶
func (*Input) PointerFrame ¶
func (*Input) PointerLeave ¶
func (*Input) PointerMotion ¶
func (*Input) ReceiveSelectionData ¶
func (input *Input) ReceiveSelectionData(mimeType string, function io.WriteCloser) error
type KeyboardHandler ¶
type KeyboardHandler interface { Key( window *Window, input *Input, time uint32, key uint32, notUnicode uint32, state wl.KeyboardKeyState, data WidgetHandler, ) Focus(window *Window, device *Input) }
type ModType ¶
type ModType uint8
ModType is the type of Mod Masks
const ModAltMask ModType = 0x02
ModAltMask is the Alt modifier mask - provided for convenience only
const ModControlMask ModType = 0x04
ModControlMask is the Control modifier mask - provided for convenience only
const ModShiftMask ModType = 0x01
ModShiftMask is the Shift modifier mask - provided for convenience only
type Popup ¶ added in v0.1.2
func (*Popup) BufferRelease ¶ added in v0.1.2
func (*Popup) HandleBufferRelease ¶ added in v0.1.2
func (w *Popup) HandleBufferRelease(ev wl.BufferReleaseEvent)
func (*Popup) HandleCallbackDone ¶ added in v0.1.2
func (w *Popup) HandleCallbackDone(ev wl.CallbackDoneEvent)
func (*Popup) HandlePopupConfigure ¶ added in v0.1.2
func (w *Popup) HandlePopupConfigure(ev zxdg.PopupConfigureEvent)
func (*Popup) HandlePopupPopupDone ¶ added in v0.1.2
func (w *Popup) HandlePopupPopupDone(ev zxdg.PopupPopupDoneEvent)
func (*Popup) HandleSurfaceConfigure ¶ added in v0.1.2
func (w *Popup) HandleSurfaceConfigure(ev zxdg.SurfaceConfigureEvent)
func (*Popup) PopupConfigure ¶ added in v0.1.2
func (*Popup) PopupGetSurface ¶ added in v0.1.2
func (*Popup) PopupPopupDone ¶ added in v0.1.2
func (w *Popup) PopupPopupDone()
func (*Popup) SetPopupHandler ¶ added in v0.2.0
func (*Popup) SurfaceConfigure ¶ added in v0.1.2
type ResizeHandler ¶
type SeatHandler ¶
type Widget ¶
type Widget struct { Window *Window // contains filtered or unexported fields }
func (*Widget) AddWidget ¶
func (parent *Widget) AddWidget(data WidgetHandler) *Widget
func (*Widget) GetAllocation ¶
func (*Widget) ScheduleRedraw ¶
func (parent *Widget) ScheduleRedraw()
func (*Widget) ScheduleResize ¶
func (*Widget) SetAllocation ¶
func (*Widget) SetUserDataWidgetHandler ¶ added in v0.2.0
func (w *Widget) SetUserDataWidgetHandler(wh WidgetHandler)
type WidgetHandler ¶
type WidgetHandler interface { Resize(Widget *Widget, width int32, height int32, pwidth int32, pheight int32) Redraw(Widget *Widget) Enter(Widget *Widget, Input *Input, x float32, y float32) Leave(Widget *Widget, Input *Input) Motion(Widget *Widget, Input *Input, time uint32, x float32, y float32) int Button( Widget *Widget, Input *Input, time uint32, button uint32, state wl.PointerButtonState, data WidgetHandler, ) TouchUp(Widget *Widget, Input *Input, serial uint32, time uint32, id int32) TouchDown( Widget *Widget, Input *Input, serial uint32, time uint32, id int32, x float32, y float32, ) TouchMotion(Widget *Widget, Input *Input, time uint32, id int32, x float32, y float32) TouchFrame(Widget *Widget, Input *Input) TouchCancel(Widget *Widget, width int32, height int32) Axis(Widget *Widget, Input *Input, time uint32, axis uint32, value float32) AxisSource(Widget *Widget, Input *Input, source uint32) AxisStop(Widget *Widget, Input *Input, time uint32, axis uint32) AxisDiscrete(Widget *Widget, Input *Input, axis uint32, discrete int32) PointerFrame(Widget *Widget, Input *Input) }
type Window ¶
type Window struct { Display *Display Userdata WidgetHandler // contains filtered or unexported fields }
func (*Window) AddPopupWidget ¶ added in v0.1.2
func (Window *Window) AddPopupWidget(p *Popup, data WidgetHandler) *Widget
func (*Window) AddWidget ¶
func (Window *Window) AddWidget(data WidgetHandler) *Widget
func (*Window) CreatePopup ¶ added in v0.1.2
func (*Window) FrameCreate ¶
func (Window *Window) FrameCreate(data WidgetHandler) *Widget
func (*Window) HandleSurfaceConfigure ¶
func (Window *Window) HandleSurfaceConfigure(ev zxdg.SurfaceConfigureEvent)
func (*Window) HandleToplevelClose ¶
func (Window *Window) HandleToplevelClose(ev zxdg.ToplevelCloseEvent)
func (*Window) HandleToplevelConfigure ¶
func (Window *Window) HandleToplevelConfigure(ev zxdg.ToplevelConfigureEvent)
func (*Window) InhibitRedraw ¶
func (Window *Window) InhibitRedraw()
func (*Window) ScheduleResize ¶
func (*Window) SetCloseHandler ¶
func (Window *Window) SetCloseHandler(handler CloseHandler)
func (*Window) SetDataHandler ¶
func (Window *Window) SetDataHandler(window *Window, handler DataHandler)
func (*Window) SetFullscreen ¶
func (*Window) SetFullscreenHandler ¶
func (Window *Window) SetFullscreenHandler(handler FullscreenHandler)
func (*Window) SetKeyboardHandler ¶
func (Window *Window) SetKeyboardHandler(handler KeyboardHandler)
func (*Window) SetMaximized ¶
func (*Window) SetMinimized ¶
func (*Window) SurfaceConfigure ¶
func (*Window) ToggleMaximized ¶
func (*Window) ToplevelClose ¶
func (*Window) ToplevelConfigure ¶
func (*Window) UninhibitRedraw ¶
func (Window *Window) UninhibitRedraw()
func (*Window) WindowGetSurface ¶
Click to show internal directories.
Click to hide internal directories.