Documentation
¶
Index ¶
- Constants
- Variables
- func DecodeKey(kc xproto.Keycode) string
- func WordWrap(text string, wrapAt int) (rows []string)
- type Context
- type Event
- type Modifiers
- type UIElementStruct
- type UIEvent
- type UIHoverEvent
- type UIPressEvent
- type UIReleaseEvent
- type UITextboxSubmitEvent
- type Window
- func (win *Window) Base(Width uint16, Height uint16, X int16, Y int16, colors [5]uint32)
- func (win *Window) BaseRaised(Width uint16, Height uint16, X int16, Y int16)
- func (win *Window) BaseSunken(Width uint16, Height uint16, X int16, Y int16)
- func (win *Window) Button(Name string, ID int16, Width uint16, Height uint16, X int16, Y int16) *UIEvent
- func (win *Window) CheckKeyPress(ev xgb.Event)
- func (win *Window) CheckKeyRelease(ev xgb.Event)
- func (win *Window) CheckMouseHover(ev xgb.Event)
- func (win *Window) CheckMousePress(ev xgb.Event)
- func (win *Window) CheckMouseRelease(ev xgb.Event)
- func (win *Window) DefaultListeners(ev xgb.Event)
- func (win *Window) DrawText(Text string, X int16, Y int16, Size int16, FGColor uint32, BGColor uint32) error
- func (win *Window) DrawUIButton(i uint8)
- func (win *Window) DrawUIButtons()
- func (win *Window) DrawUIElement(ev *UIEvent)
- func (win *Window) DrawUIElements()
- func (win *Window) DrawUILabel(i uint8)
- func (win *Window) DrawUILabels()
- func (win *Window) DrawUITextbox(i uint8)
- func (win *Window) DrawUITextboxes()
- func (win *Window) Label(Name string, ID int16, Width uint16, Height uint16, X int16, Y int16, ...) *UIEvent
- func (win *Window) NewUIEvent(Name string, ID int16, Width uint16, Height uint16, X int16, Y int16, ...) *UIEvent
- func (win *Window) NewUIEventWithPresetState(Name string, ID int16, Width uint16, Height uint16, X int16, Y int16, ...) *UIEvent
- func (win *Window) NoMoreUIEvents() bool
- func (win *Window) PercentOfHeight(per uint16) int16
- func (win *Window) PercentOfWidth(per uint16) int16
- func (win *Window) Square(Width uint16, Height uint16, X int16, Y int16, Colors []uint32)
- func (win *Window) Textbox(Name string, ID int16, Width uint16, Height uint16, X int16, Y int16) *UIEvent
- func (win *Window) TextboxBase(Width uint16, Height uint16, X int16, Y int16)
- func (win *Window) WaitForUIEvent() Event
Constants ¶
View Source
const ( // Names for special keys. NameLeftArrow = "←" NameRightArrow = "→" NameUpArrow = "↑" NameDownArrow = "↓" NameReturn = "⏎" NameEnter = "⌤" NameEscape = "⎋" NameHome = "⇱" NameEnd = "⇲" NameDeleteBackward = "⌫" NameDeleteForward = "⌦" NamePageUp = "⇞" NamePageDown = "⇟" NameTab = "Tab" NameSpace = "Space" NameCtrl = "Ctrl" NameShift = "Shift" NameAlt = "Alt" NameSuper = "Super" NameCommand = "⌘" NameF1 = "F1" NameF2 = "F2" NameF3 = "F3" NameF4 = "F4" NameF5 = "F5" NameF6 = "F6" NameF7 = "F7" NameF8 = "F8" NameF9 = "F9" NameF10 = "F10" NameF11 = "F11" NameF12 = "F12" NameBack = "Back" )
View Source
const ( ButtonType int8 = 0 TextboxType int8 = 1 LabelType int8 = 2 )
Variables ¶
View Source
var ButtonNum uint8 = 0
View Source
var LabelNum uint8 = 0
View Source
var MousePos struct { X int16 Y int16 }
View Source
var TextboxNum uint8 = 0
View Source
var UIEventNum uint8 = 0
View Source
var UIEvents []*UIEvent = make([]*UIEvent, 255)
Functions ¶
Types ¶
type Context ¶ added in v1.0.0
type Context struct { Ctx *C.struct_xkb_context // contains filtered or unexported fields }
var (
KeyContext *Context
)
func (*Context) DestroyKeymapState ¶ added in v1.0.0
func (x *Context) DestroyKeymapState()
func (*Context) DispatchKey ¶ added in v1.0.0
func (*Context) SetKeymap ¶ added in v1.0.0
SetKeymap sets the keymap and state. The context takes ownership of the keymap and state and frees them in Destroy.
func (*Context) UpdateKeymap ¶ added in v1.0.0
type Modifiers ¶ added in v1.0.0
type Modifiers uint32
Modifiers
const ( // ModCtrl is the ctrl modifier key. ModCtrl Modifiers = 1 << iota // ModCommand is the command modifier key // found on Apple keyboards. ModCommand // ModShift is the shift modifier key. ModShift // ModAlt is the alt modifier key, or the option // key on Apple keyboards. ModAlt // ModSuper is the "logo" modifier key, often // represented by a Windows logo. ModSuper )
type UIElementStruct ¶ added in v1.0.0
Types of elements
var UIElements UIElementStruct = UIElementStruct{ make([]*UIEvent, 16), make([]*UIEvent, 16), make([]*UIEvent, 64), }
type UIEvent ¶
type UIEvent struct { Name string Width uint16 Height uint16 X int16 Y int16 ID int16 // user supplied id State int8 // dependent on the element, see their respective comments Type int8 // 0: button, 1: textbox, 2: label // contains filtered or unexported fields }
Any event that needs to be drawn and checked on
type UIHoverEvent ¶
What returns when we hover over something
func (UIHoverEvent) String ¶
func (v UIHoverEvent) String() string
type UIPressEvent ¶
What returns when we click something
func (UIPressEvent) String ¶
func (v UIPressEvent) String() string
type UIReleaseEvent ¶
What returns when we release our click on something
func (UIReleaseEvent) String ¶
func (v UIReleaseEvent) String() string
type UITextboxSubmitEvent ¶ added in v1.0.0
What returns when we hit enter on a textbox
func (UITextboxSubmitEvent) String ¶ added in v1.0.0
func (v UITextboxSubmitEvent) String() string
type Window ¶
type Window struct { Conn *xgb.Conn Screen *xproto.ScreenInfo Window xproto.Window Width uint16 Height uint16 // contains filtered or unexported fields }
func NewWindowComplex ¶
func NewWindowComplex(Width uint16, Height uint16, BorderWidth uint16, Mask uint32, Flags []uint32) (win Window, err error)
Function for creating a new window without any default options in place
func (*Window) BaseRaised ¶
func (*Window) BaseSunken ¶
func (*Window) CheckKeyPress ¶
func (*Window) CheckKeyRelease ¶
func (*Window) CheckMouseHover ¶
func (*Window) CheckMousePress ¶
func (*Window) CheckMouseRelease ¶
func (*Window) DefaultListeners ¶
goroutine for a switch that listens for all the default shit we usually want.
func (*Window) DrawUIButtons ¶ added in v1.0.0
func (win *Window) DrawUIButtons()
func (*Window) DrawUILabel ¶ added in v1.0.0
Draw a UI label
func (*Window) DrawUILabels ¶ added in v1.0.0
func (win *Window) DrawUILabels()
func (*Window) DrawUITextboxes ¶ added in v1.0.0
func (win *Window) DrawUITextboxes()
func (*Window) NewUIEvent ¶
func (win *Window) NewUIEvent(Name string, ID int16, Width uint16, Height uint16, X int16, Y int16, eventType int8, id uint8) *UIEvent
Make a new UI event
func (*Window) NewUIEventWithPresetState ¶ added in v1.0.0
func (*Window) NoMoreUIEvents ¶
Check if we have any UI events left
func (*Window) PercentOfHeight ¶ added in v1.0.0
func (*Window) PercentOfWidth ¶ added in v1.0.0
func (*Window) TextboxBase ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.