Documentation ¶
Index ¶
- Constants
- Variables
- func AddMixins(widget Widget, mixin any)
- func ApplyTheme(kind ThemeKind, themes ...string)
- func CheckPermissions(permission []string) map[string]int
- func CursorPositionScreenToWindow(window Window, px, py float32) (x, y float32)
- func CursorPositionWindowToScreen(window Window, px, py float32) (x, y float32)
- func DebugCheckMainThread()
- func EjectChild(child Widget)
- func GestureArenaManager() *gestureArenaManager
- func GestureManager() *gestureRecognizerManager
- func GetCursorScreenPosition() (x, y float32)
- func GetCursorWindowPosition(window Window) (x, y float32)
- func GotoUI(callback func())
- func HoverGestureManager() *hoverGestureManager
- func InvalidateRect(x, y, width, height int32)
- func IsMainThread() bool
- func MountWidget(child Widget, parent Parent)
- func OnDoubleTap(widget Widget, callback GestureCallback)
- func OnHover(widget Widget, callback GestureCallback)
- func OnHoverEnter(widget Widget, callback GestureCallback)
- func OnHoverExit(widget Widget, callback GestureCallback)
- func OnLongPress(widget Widget, callback GestureCallback)
- func OnLongPressMove(widget Widget, callback GestureCallback)
- func OnLongPressUp(widget Widget, callback GestureCallback)
- func OnOtherTap(widget Widget, callback GestureCallback)
- func OnOtherTapCancel(widget Widget, callback GestureCallback)
- func OnOtherTapDown(widget Widget, callback GestureCallback)
- func OnOtherTapUp(widget Widget, callback GestureCallback)
- func OnPanCancel(widget Widget, callback GestureCallback)
- func OnPanDown(widget Widget, callback GestureCallback)
- func OnPanUp(widget Widget, callback GestureCallback)
- func OnPanUpdate(widget Widget, callback GestureCallback)
- func OnScaleEnd(widget Widget, callback GestureCallback)
- func OnScaleStart(widget Widget, callback GestureCallback)
- func OnScaleUpdate(widget Widget, callback GestureCallback)
- func OnScrollX(widget Widget, callback GestureCallback)
- func OnScrollY(widget Widget, callback GestureCallback)
- func OnSecondaryTap(widget Widget, callback GestureCallback)
- func OnSecondaryTapCancel(widget Widget, callback GestureCallback)
- func OnSecondaryTapDown(widget Widget, callback GestureCallback)
- func OnSecondaryTapUp(widget Widget, callback GestureCallback)
- func OnTap(widget Widget, callback GestureCallback)
- func OnTapCancel(widget Widget, callback GestureCallback)
- func OnTapDown(widget Widget, callback GestureCallback)
- func OnTapUp(widget Widget, callback GestureCallback)
- func PickFileDialog() *pickFileDialog
- func RegisterType(niltype any, creator Creator)
- func RemoveDoubleTapGesture(widget Widget, callback GestureCallback)
- func RemoveLongPressGesture(widget Widget, callback GestureCallback)
- func RemoveLongPressMoveGesture(widget Widget, callback GestureCallback)
- func RemoveLongPressUpGesture(widget Widget, callback GestureCallback)
- func RemovePanCancelGesture(widget Widget, callback GestureCallback)
- func RemovePanDownGesture(widget Widget, callback GestureCallback)
- func RemovePanUpGesture(widget Widget, callback GestureCallback)
- func RemovePanUpdateGesture(widget Widget, callback GestureCallback)
- func RequestFocus(widget Widget)
- func RequestLayout(widget Widget)
- func RequestPermissions(permission []string, callback func(map[string]int))
- func RequestRedraw(widget Widget)
- func RunOnUI(callback func())
- func SaveFileDialog() *saveFileDialog
- func ScreenSize() (width, height int32)
- func SetTextInputRect(x, y, width, height float32)
- func StartTextInput()
- func StateFromString(state string) uint32
- func StateToString(state uint32) string
- func StopTextInput()
- func Use(use ...any)
- func ViewFileDialog() *viewFileDialog
- type Application
- type Attr
- func (me Attr) Get(key string, defaultValue any) any
- func (me Attr) GetArray(key string, defaultValue []any) []any
- func (me Attr) GetAttr(key string, defaultValue Attr) Attr
- func (me Attr) GetAttrArray(key string, defaultValue []Attr) []Attr
- func (me Attr) GetBool(key string, defaultValue bool) bool
- func (me Attr) GetColor(key string, defaultValue Color) (result Color)
- func (me Attr) GetDimen(key string, defaultValue string) Dimen
- func (me Attr) GetFloat32(key string, defaultValue float32) float32
- func (me Attr) GetFloat32Array(key string, defaultValue []float32) []float32
- func (me Attr) GetFloat64(key string, defaultValue float64) float64
- func (me Attr) GetInt(key string, defaultValue int) int
- func (me Attr) GetInt32(key string, defaultValue int32) int32
- func (me Attr) GetInt64(key string, defaultValue int64) int64
- func (me Attr) GetString(key string, defaultValue string) string
- func (me Attr) GetStringArray(key string, defaultValue []string) []string
- func (me Attr) GetUint32(key string, defaultValue uint32) (result uint32)
- func (me Attr) Has(key string) bool
- func (me Attr) Merge(attr ...Attr)
- func (me Attr) Set(key string, value any)
- func (me Attr) String() string
- type Canvas
- type Color
- type Component
- type ComponentBase
- type Creator
- type Cursor
- type Dimen
- type DoubleTapGestureRecognizer
- type Draw
- type Drawable
- type DrawableCreator
- type Eject
- type Event
- type EventAction
- type EventType
- type Focus
- type Font
- type FontLayout
- type FontWeight
- type Frame
- type GestureArenaMember
- type GestureCallback
- type GestureDetail
- type GestureRecognizer
- type GestureState
- type Gradient
- type HitTestResult
- type HitTestable
- type Image
- type KeyCode
- type KeyEvent
- type KeyEventHandler
- type Kind
- type Layout
- type Manifest
- type Margin
- type Matrix
- type Measure
- type MeasureDimen
- type Menu
- type MenuItem
- type Mode
- type Mount
- type NativeCursor
- type OnCreate
- type OutsideShadow
- type Padding
- type Paint
- type PaintStyle
- type Parent
- type Path
- type PointerButton
- type PointerEvent
- type Rect
- type Response
- type ScrollEvent
- type Side
- type Size
- type StateBase
- type Stateable
- type TapGestureRecognizer
- type Theme
- type ThemeKind
- type Timer
- type TypingEvent
- type TypingEventHandler
- type Widget
- type WidgetBase
- type WidgetCreator
- type WidgetInfo
- type WidgetOutsideShadow
- type WidgetParent
- func (me *WidgetParent) AddChild(child ...Widget)
- func (me *WidgetParent) ChildAt(index int) Widget
- func (me *WidgetParent) Children() []Widget
- func (me *WidgetParent) ChildrenCount() int
- func (me *WidgetParent) Find(id string) Widget
- func (me *WidgetParent) GetWidget(id string) Widget
- func (me *WidgetParent) InsertChild(index int, child ...Widget)
- func (me *WidgetParent) RemoveChild(child Widget) int
- func (me *WidgetParent) RemoveChildAt(index int)
- func (me *WidgetParent) ReplaceChild(src, dest Widget) int
- type WidgetSize
- func (me *WidgetSize) AddSizeObserver(observer func())
- func (me *WidgetSize) Frame() *Frame
- func (me *WidgetSize) Height() Dimen
- func (me *WidgetSize) Margin() *Margin
- func (me *WidgetSize) Padding() *Padding
- func (me *WidgetSize) RemoveSizeObserver(observer func())
- func (me *WidgetSize) ScrollTo(x, y float32)
- func (me *WidgetSize) ScrollX() float32
- func (me *WidgetSize) ScrollY() float32
- func (me *WidgetSize) SetHeight(height Dimen)
- func (me *WidgetSize) SetMargin(margin *Margin)
- func (me *WidgetSize) SetPadding(padding *Padding)
- func (me *WidgetSize) SetScroll(x, y float32)
- func (me *WidgetSize) SetWidth(width Dimen)
- func (me *WidgetSize) Width() Dimen
- type Window
- type WindowEvent
Constants ¶
const ( GESTURE_DOWN_DELAY = 100 * time.Millisecond GESTURE_DOWN2UP_DELAY = 100 * time.Millisecond GESTURE_LONG_PRESS_TIMEOUT = 500 * time.Millisecond GESTURE_DOUBLETAP_TIMEOUT = 300 * time.Millisecond GESTURE_MIN_PAN_DISTANCE float32 = 10 /*use dp*/ )
const ( Mod_CapsLock uint32 = 0x10000 << iota Mod_Shift uint32 = 0x10000 << iota Mod_Control uint32 = 0x10000 << iota Mod_Alt uint32 = 0x10000 << iota Mod_Super uint32 = 0x10000 << iota Mod_Mask uint32 = 0xFFFF0000 )
const ( State_Disabled uint32 = 1 << iota State_Pressed State_Focused State_Hovered State_Checked State_Visited // state of visited links State_Invalid // invalid of input State_Default uint32 = 0 )
const AllMaskBits = (xlib.CWBorderPixel | xlib.CWColormap | xlib.CWEventMask)
const (
MaxMeasuredDimen int32 = 0x3FFFFFFF
)
const XALL_EVENT = (xlib.KeyPressMask | xlib.KeyReleaseMask | xlib.ButtonPressMask | xlib.ButtonReleaseMask | xlib.EnterWindowMask | xlib.LeaveWindowMask | xlib.PointerMotionMask | xlib.Button1MotionMask | xlib.Button2MotionMask | xlib.Button3MotionMask | xlib.Button4MotionMask | xlib.Button5MotionMask | xlib.ButtonMotionMask | xlib.KeymapStateMask | xlib.ExposureMask | xlib.VisibilityChangeMask | xlib.StructureNotifyMask | xlib.SubstructureNotifyMask | xlib.FocusChangeMask | xlib.PropertyChangeMask)
const XALL_EVENT2 = (xlib.StructureNotifyMask | xlib.KeyPressMask | xlib.KeyReleaseMask | xlib.PointerMotionMask | xlib.ButtonPressMask | xlib.ButtonReleaseMask | xlib.ExposureMask | xlib.FocusChangeMask | xlib.VisibilityChangeMask | xlib.EnterWindowMask | xlib.LeaveWindowMask | xlib.PropertyChangeMask)
Variables ¶
var TestDraw func(Canvas)
Functions ¶
func ApplyTheme ¶
func CheckPermissions ¶
func DebugCheckMainThread ¶
func DebugCheckMainThread()
func EjectChild ¶
func EjectChild(child Widget)
func GestureArenaManager ¶
func GestureArenaManager() *gestureArenaManager
func GestureManager ¶
func GestureManager() *gestureRecognizerManager
func GetCursorScreenPosition ¶
func GetCursorScreenPosition() (x, y float32)
Retrieves the position of the mouse cursor, in screen coordinates.
func GetCursorWindowPosition ¶
Retrieves the position of the mouse cursor, in window coordinates.
func HoverGestureManager ¶
func HoverGestureManager() *hoverGestureManager
func InvalidateRect ¶
func InvalidateRect(x, y, width, height int32)
func IsMainThread ¶
func IsMainThread() bool
func MountWidget ¶
func OnDoubleTap ¶
func OnDoubleTap(widget Widget, callback GestureCallback)
func OnHover ¶
func OnHover(widget Widget, callback GestureCallback)
func OnHoverEnter ¶
func OnHoverEnter(widget Widget, callback GestureCallback)
func OnHoverExit ¶
func OnHoverExit(widget Widget, callback GestureCallback)
func OnLongPress ¶
func OnLongPress(widget Widget, callback GestureCallback)
func OnLongPressMove ¶
func OnLongPressMove(widget Widget, callback GestureCallback)
func OnLongPressUp ¶
func OnLongPressUp(widget Widget, callback GestureCallback)
func OnOtherTap ¶
func OnOtherTap(widget Widget, callback GestureCallback)
func OnOtherTapCancel ¶
func OnOtherTapCancel(widget Widget, callback GestureCallback)
func OnOtherTapDown ¶
func OnOtherTapDown(widget Widget, callback GestureCallback)
func OnOtherTapUp ¶
func OnOtherTapUp(widget Widget, callback GestureCallback)
func OnPanCancel ¶
func OnPanCancel(widget Widget, callback GestureCallback)
func OnPanDown ¶
func OnPanDown(widget Widget, callback GestureCallback)
func OnPanUp ¶
func OnPanUp(widget Widget, callback GestureCallback)
func OnPanUpdate ¶
func OnPanUpdate(widget Widget, callback GestureCallback)
func OnScaleEnd ¶
func OnScaleEnd(widget Widget, callback GestureCallback)
func OnScaleStart ¶
func OnScaleStart(widget Widget, callback GestureCallback)
func OnScaleUpdate ¶
func OnScaleUpdate(widget Widget, callback GestureCallback)
func OnScrollX ¶
func OnScrollX(widget Widget, callback GestureCallback)
func OnScrollY ¶
func OnScrollY(widget Widget, callback GestureCallback)
func OnSecondaryTap ¶
func OnSecondaryTap(widget Widget, callback GestureCallback)
func OnSecondaryTapCancel ¶
func OnSecondaryTapCancel(widget Widget, callback GestureCallback)
func OnSecondaryTapDown ¶
func OnSecondaryTapDown(widget Widget, callback GestureCallback)
func OnSecondaryTapUp ¶
func OnSecondaryTapUp(widget Widget, callback GestureCallback)
func OnTap ¶
func OnTap(widget Widget, callback GestureCallback)
func OnTapCancel ¶
func OnTapCancel(widget Widget, callback GestureCallback)
func OnTapDown ¶
func OnTapDown(widget Widget, callback GestureCallback)
func OnTapUp ¶
func OnTapUp(widget Widget, callback GestureCallback)
func PickFileDialog ¶
func PickFileDialog() *pickFileDialog
------------- PickFileDialog -----------------
func RegisterType ¶
func RemoveDoubleTapGesture ¶
func RemoveDoubleTapGesture(widget Widget, callback GestureCallback)
widget will auto clear all gesture when destroy
func RemoveLongPressGesture ¶
func RemoveLongPressGesture(widget Widget, callback GestureCallback)
func RemoveLongPressMoveGesture ¶
func RemoveLongPressMoveGesture(widget Widget, callback GestureCallback)
func RemoveLongPressUpGesture ¶
func RemoveLongPressUpGesture(widget Widget, callback GestureCallback)
func RemovePanCancelGesture ¶
func RemovePanCancelGesture(widget Widget, callback GestureCallback)
func RemovePanDownGesture ¶
func RemovePanDownGesture(widget Widget, callback GestureCallback)
func RemovePanUpGesture ¶
func RemovePanUpGesture(widget Widget, callback GestureCallback)
func RemovePanUpdateGesture ¶
func RemovePanUpdateGesture(widget Widget, callback GestureCallback)
func RequestFocus ¶
func RequestFocus(widget Widget)
func RequestLayout ¶
func RequestLayout(widget Widget)
func RequestPermissions ¶
func RequestRedraw ¶
func RequestRedraw(widget Widget)
func SaveFileDialog ¶
func SaveFileDialog() *saveFileDialog
---------------- SaveFileDialog -------------------
func ScreenSize ¶
func ScreenSize() (width, height int32)
func SetTextInputRect ¶
func SetTextInputRect(x, y, width, height float32)
func StartTextInput ¶
func StartTextInput()
func StateFromString ¶
func StateToString ¶
func StopTextInput ¶
func StopTextInput()
func ViewFileDialog ¶
func ViewFileDialog() *viewFileDialog
----------- ViewFileDialog -------------------
Types ¶
type Application ¶
type Application interface { Init(manifest string) Run() Terminate() Manifest() Attr MainWindow() Window }
func App ¶
func App() Application
type Attr ¶
func InflateStyle ¶
func InflateStyles ¶
func MergeAttrs ¶
merge attrs to a new single attr, the back will override front
func ParseAttrWitthError ¶
func (Attr) GetFloat32Array ¶ added in v0.0.7
func (Attr) GetStringArray ¶
type Canvas ¶
type Canvas interface { Save() Restore() Translate(x, y float32) Scale(x, y float32) Rotate(angle float32) Skew(x, y float32) // https://developer.android.com/reference/android/graphics/Canvas#skew(float,%20float) Transform(a, b, c, d, e, f float32) // SetMatrix(matrix Matrix) // https://cairographics.org/manual/cairo-Transformations.html#cairo-set-matrix GetMatrix() Matrix // https://cairographics.org/manual/cairo-Transformations.html#cairo-get-matrix ClipRect(x, y, width, height float32) ClipRoundRect(x, y, width, height, cornerX, cornerY float32) ClipPath(path Path) ///////////// draw SetAlpha(alpha float32) DrawRect(x, y, width, height float32, paint Paint) DrawRoundRect(x, y, width, height float32, rLT, rRT, rRB, rLB float32, paint Paint) DrawArc(x, y, radius, startAngle, endAngle float32, useCenter bool, paint Paint) DrawOval(x, y, width, height float32, paint Paint) DrawPath(path Path, paint Paint) // DrawColor(color Color) DrawImage(img Image) ResetClip() Flush() Destroy() // contains filtered or unexported methods }
type ComponentBase ¶
type ComponentBase struct {
// contains filtered or unexported fields
}
func NewComponentBase ¶
func NewComponentBase(owner Widget, attr Attr) *ComponentBase
func (*ComponentBase) Content ¶
func (me *ComponentBase) Content() Widget
func (*ComponentBase) Info ¶
func (me *ComponentBase) Info() *WidgetInfo
func (*ComponentBase) SetContent ¶
func (me *ComponentBase) SetContent(content Widget)
type Creator ¶
func FindTypeCreator ¶
type Cursor ¶
type Cursor interface {
Set()
}
func LoadNativeCursor ¶
func LoadNativeCursor(c NativeCursor) Cursor
type DoubleTapGestureRecognizer ¶
type DoubleTapGestureRecognizer interface { GestureRecognizer }
type Drawable ¶
type DrawableCreator ¶
type EventAction ¶
type EventAction int
const ( Action_None EventAction = iota Action_Down // Action_Move Action_Drag Action_Up Action_Hover Action_Scroll Action_Pressure // typing Action_Input Action_Preedit Action_WindowCreated Action_WindowMeasured Action_WindowDraw Action_WindowFocusGained Action_WindowFocusLost Action_WindowActived Action_WindowHide )
func (EventAction) String ¶
func (me EventAction) String() string
type Font ¶
type FontLayout ¶
type FontLayout interface { MeasureText(font Font, paint Paint, text string, width, height int32) (textWidth, textHeight int32) DrawText(canvas Canvas, font Font, paint Paint, text string, width, height int32) CharacterIndexForPoint(font Font, text string, width, height int32, x, y float32) uint32 // contains filtered or unexported methods }
func NewFontLayout ¶
func NewFontLayout() FontLayout
type FontWeight ¶
type FontWeight int
const ( FontWeight_Thin FontWeight = 100 FontWeight_ExtraLight FontWeight = 200 FontWeight_Light FontWeight = 300 FontWeight_Normal FontWeight = 400 FontWeight_Medium FontWeight = 500 FontWeight_SemiBold FontWeight = 600 FontWeight_Bold FontWeight = 700 FontWeight_ExtraBold FontWeight = 800 FontWeight_Black FontWeight = 900 )
func FontWeightFromName ¶
func FontWeightFromName(name string) FontWeight
type GestureArenaMember ¶
type GestureCallback ¶
type GestureCallback func(detail GestureDetail)
type GestureDetail ¶
type GestureRecognizer ¶
type GestureRecognizer interface { GestureArenaMember PointerAllowed(event PointerEvent) bool HandleAllowedPointer(event PointerEvent) Clear(widget Widget) // clear callbacks of widget when ejected }
type GestureState ¶
type GestureState int
const ( GestureState_Ready GestureState = iota + 1 GestureState_Possible GestureState_Accepted GestureState_Rejected )
type HitTestResult ¶
type HitTestResult interface { Add(widget Widget) Remove(widget Widget) Contain(widget Widget) bool Results() []Widget }
func NewHitTestResult ¶
func NewHitTestResult() HitTestResult
type HitTestable ¶
type HitTestable interface {
HitTest(widget Widget, hitTestResult HitTestResult, event PointerEvent)
}
type Image ¶
func LoadImageFromFile ¶
func LoadImageSVGFromFile ¶
func LoadImageSVGFromReader ¶
func ReadImageSVG ¶
type KeyCode ¶
type KeyCode uint32
const ( Key_A KeyCode = 0x61 // XK_a Key_B KeyCode = 0x62 // XK_b Key_C KeyCode = 0x63 // XK_c Key_D KeyCode = 0x64 // XK_d Key_E KeyCode = 0x65 // XK_e Key_F KeyCode = 0x66 // XK_f Key_G KeyCode = 0x67 // XK_g Key_H KeyCode = 0x68 // XK_h Key_I KeyCode = 0x69 // XK_i Key_J KeyCode = 0x6a // XK_j Key_K KeyCode = 0x6b // XK_k Key_L KeyCode = 0x6c // XK_l Key_M KeyCode = 0x6d // XK_m Key_N KeyCode = 0x6e // XK_n Key_O KeyCode = 0x6f // XK_o Key_P KeyCode = 0x70 // XK_p Key_Q KeyCode = 0x71 // XK_q Key_R KeyCode = 0x72 // XK_r Key_S KeyCode = 0x73 // XK_s Key_T KeyCode = 0x74 // XK_t Key_U KeyCode = 0x75 // XK_u Key_V KeyCode = 0x76 // XK_v Key_W KeyCode = 0x77 // XK_w Key_X KeyCode = 0x78 // XK_x Key_Y KeyCode = 0x79 // XK_y Key_Z KeyCode = 0x7a // XK_z Key_0 KeyCode = 0x30 // XK_0 Key_1 KeyCode = 0x31 // XK_1 Key_2 KeyCode = 0x32 // XK_2 Key_3 KeyCode = 0x33 // XK_3 Key_4 KeyCode = 0x34 // XK_4 Key_5 KeyCode = 0x35 // XK_5 Key_6 KeyCode = 0x36 // XK_6 Key_7 KeyCode = 0x37 // XK_7 Key_8 KeyCode = 0x38 // XK_8 Key_9 KeyCode = 0x39 // XK_9 Key_F1 KeyCode = 0xffbe // XK_F1 Key_F2 KeyCode = 0xffbf // XK_F2 Key_F3 KeyCode = 0xffc0 // XK_F3 Key_F4 KeyCode = 0xffc1 // XK_F4 Key_F5 KeyCode = 0xffc2 // XK_F5 Key_F6 KeyCode = 0xffc3 // XK_F6 Key_F7 KeyCode = 0xffc4 // XK_F7 Key_F8 KeyCode = 0xffc5 // XK_F8 Key_F9 KeyCode = 0xffc6 // XK_F9 Key_F10 KeyCode = 0xffc7 // XK_F10 Key_F11 KeyCode = 0xffc8 // XK_F11 Key_F12 KeyCode = 0xffc9 // XK_F12 Key_F13 KeyCode = 0xffca // XK_F13 Key_F14 KeyCode = 0xffcb // XK_F14 Key_F15 KeyCode = 0xffcc // XK_F15 Key_F16 KeyCode = 0xffcd // XK_F16 Key_F17 KeyCode = 0xffce // XK_F17 Key_F18 KeyCode = 0xffcf // XK_F18 Key_F19 KeyCode = 0xffd0 // XK_F19 Key_F20 KeyCode = 0xffd1 // XK_F20 Key_Return KeyCode = 0xff0d // XK_Return Key_Tab KeyCode = 0xff09 // XK_Tab Key_Space KeyCode = 0x0020 // XK_space Key_BackSpace KeyCode = 0xff08 // XK_BackSpace Key_Escape KeyCode = 0xff1b // XK_Escape Key_CapsLock KeyCode = 0xffe5 // XK_Caps_Lock Key_Alt KeyCode = 0xffe9 // XK_Alt_L Key_RightAlt KeyCode = 0xffea // XK_Alt_R Key_Shift KeyCode = 0xffe1 // XK_Shift_L Key_RightShift KeyCode = 0xffe2 // XK_Shift_R Key_Control KeyCode = 0xffe3 // XK_Control_L Key_RightControl KeyCode = 0xffe4 // XK_Control_R Key_Command KeyCode = Key_Unknow // unknow Key_Equal KeyCode = 0x003d // XK_equal =+ Key_Minus KeyCode = 0x002d // XK_minus -_ Key_LeftBracket KeyCode = 0x005b // XK_bracketleft [{ Key_RightBracket KeyCode = 0x005d // XK_bracketright ]} Key_Quote KeyCode = 0x0027 // XK_apostrophe '" Key_Semicolon KeyCode = 0x003b // XK_semicolon ;: Key_Comma KeyCode = 0x002c // XK_comma ,< Key_Period KeyCode = 0x002e // XK_period .> Key_Slash KeyCode = 0x002f // XK_slash /? Key_Backslash KeyCode = 0x005c // XK_backslash \| Key_Grave KeyCode = 0x0060 // XK_grave `~ Key_Menu KeyCode = 0xff67 // XK_Menu Key_Function KeyCode = Key_Unknow // Unknow Key_Left KeyCode = 0xff51 // XK_Left Key_Right KeyCode = 0xff53 // XK_Right Key_Down KeyCode = 0xff54 // XK_Down Key_Up KeyCode = 0xff52 // XK_Up Key_Mute KeyCode = Key_Unknow // Unknow Key_VolumeUp KeyCode = Key_Unknow // Unknow Key_VolumeDown KeyCode = Key_Unknow // Unknow Key_Home KeyCode = 0xff50 // XK_Home Key_End KeyCode = 0xff57 // XK_End Key_PageUp KeyCode = 0xff55 // XK_Page_Up Key_PageDown KeyCode = 0xff56 // XK_Page_Down Key_Delete KeyCode = 0xffff // XK_Delete Key_Insert KeyCode = 0xff63 // XK_Insert Key_Help KeyCode = Key_Unknow // Unknow Key_Pad0 KeyCode = 0xffb0 // XK_KP_0 Key_Pad1 KeyCode = 0xffb1 // XK_KP_1 Key_Pad2 KeyCode = 0xffb2 // XK_KP_2 Key_Pad3 KeyCode = 0xffb3 // XK_KP_3 Key_Pad4 KeyCode = 0xffb4 // XK_KP_4 Key_Pad5 KeyCode = 0xffb5 // XK_KP_5 Key_Pad6 KeyCode = 0xffb6 // XK_KP_6 Key_Pad7 KeyCode = 0xffb7 // XK_KP_7 Key_Pad8 KeyCode = 0xffb8 // XK_KP_8 Key_Pad9 KeyCode = 0xffb9 // XK_KP_9 Key_PadDecimal KeyCode = 0xffae // XK_KP_Decimal Key_PadPlus KeyCode = 0xffab // XK_KP_Add + Key_PadMinus KeyCode = 0xffad // XK_KP_Subtract - Key_PadMultiply KeyCode = 0xffaa // XK_KP_Multiply * Key_PadDivide KeyCode = 0xffaf // XK_KP_Divide / Key_PadEnter KeyCode = 0xff8d // XK_KP_Enter Key_PadNumLock KeyCode = 0xff7f // XK_Num_Lock Key_PadBegin KeyCode = 0xff9d // XK_KP_Begin Key_Clear KeyCode = 0xff0b // XK_Clear Key_ScrollLock KeyCode = 0xff14 // XK_Scroll_Lock Key_Pause KeyCode = 0xff13 // XK_Pause Key_Snapshot KeyCode = 0xff15 // XK_Sys_Req Key_PadEquals KeyCode = Key_Unknow // Unknow Key_Back KeyCode = Key_Unknow // AKEYCODE_BACK )
const (
Key_Unknow KeyCode = 0xffffffff
)
type KeyEventHandler ¶
type Kind ¶
type Kind int
const ( Kind_None Kind = 0 + iota // Kind_Mouse // A mouse-based pointer device. Kind_Touch // A touch-based pointer device. Kind_Stylus // Kind_Stylus A pointer device with a stylus that has been inverted. Kind_InvertedStylus // A pointer device with a stylus that has been inverted. Kind_Tablet // An tablet pointer device, same with mouse? Kind_Other // An other unknown pointer device. )
type Manifest ¶
type Manifest interface { Name() string AppID() string Package() string Version() string VersionCode() string VersionID() string Permissions() []string // Main main widget Main() string }
func NewManifest ¶
type Margin ¶
margin: !auto 10px 10dp 1em 1wt 5% !ratio !unlimit margin: {left: 10px, top: 10px, right: 10px, bottom: 10px} margin: 10px, 10px, 10px, 10px margin: 10px
type Measure ¶
type Measure interface {
Measure(width, height MeasureDimen)
}
type MeasureDimen ¶
type MeasureDimen int32
Non-negative and only support Pixel, Auto, Unlimit
func MeasureSpec ¶
func MeasureSpec(value int32, mode Mode) MeasureDimen
TODO:: rename to AMeasureDimen ?
func (MeasureDimen) Mode ¶
func (me MeasureDimen) Mode() Mode
func (MeasureDimen) String ¶
func (me MeasureDimen) String() string
func (MeasureDimen) Value ¶
func (me MeasureDimen) Value() int32
type NativeCursor ¶
type NativeCursor int
const ( CursorArrow NativeCursor = iota CursorIBeam CursorWait CursorCrosshair CursorResizeWE CursorResizeNS CursorResizeNWSE CursorResizeNESW CursorFinger CursorHand CursorDrag CursorSizeAll CursorCustom )
type OutsideShadow ¶
type Padding ¶
padding: only supported definite size and Percent size
10px 10dp 1em 5% !auto !wt !ratio !unlimit padding Percent size is associate with parent size, eg: 5% = 0.05*parent.Width
func NewPadding ¶
padding: {left: 10px, top: 10px, right: 10px, bottom: 10px} padding: 10px, 10px, 10px, 10px padding: 10px
type Paint ¶
type Paint interface { Color() Color SetColor(color Color) AntiAlias() bool SetAntiAlias(antialias bool) Width() float32 SetWidth(width float32) Style() PaintStyle SetStyle(style PaintStyle) // TextSize() float32 // TODO:: no use // SetTextSize(size float32) SetDash(dash []float32) Dash() []float32 SetShadow(color Color, offsetX, offsetY, blur float32) Shadow() (color Color, offsetX, offsetY, blur float32) HasShadow() bool // contains filtered or unexported methods }
type PaintStyle ¶
type PaintStyle int
const ( PaintStyle_Fill PaintStyle = 1 PaintStyle_Stroke PaintStyle = 2 PaintStyle_Both PaintStyle = 1 | 2 )
type Parent ¶
type Parent interface { Widget InsertChild(index int, child ...Widget) AddChild(child ...Widget) RemoveChildAt(index int) RemoveChild(child Widget) (index int) ReplaceChild(src, dest Widget) (index int) Children() []Widget // the order of Children is from bottom to top ChildrenCount() int ChildAt(index int) Widget Find(id string) Widget }
type Path ¶
type Path interface { Rect(x, y, width, height float32) RoundRect(x, y, width, height, rLT, rRT, rRB, rLB float32) Ellipse(cx, cy, rx, ry float32) MoveTo(x, y float32) LineTo(x, y float32) CurveTo(x1, y1, x2, y2, x3, y3 float32) CurveToV(x2, y2, x3, y3 float32) Close() // contains filtered or unexported methods }
type PointerButton ¶
type PointerButton int
const ( ButtonNone PointerButton = iota ButtonPrimary ButtonSecondary ButtonMiddle ButtonX1 ButtonX2 ButtonOther )
func (PointerButton) String ¶
func (me PointerButton) String() string
type PointerEvent ¶
type ScrollEvent ¶
type Size ¶
type Size interface { Width() Dimen SetWidth(width Dimen) Height() Dimen SetHeight(height Dimen) Margin() *Margin // can be nil SetMargin(*Margin) // can be nil Padding() *Padding // can be nil SetPadding(*Padding) // can be nil Frame() *Frame // not nil ScrollX() float32 ScrollY() float32 SetScroll(x, y float32) ScrollTo(x, y float32) AddSizeObserver(observer func()) RemoveSizeObserver(observer func()) }
type StateBase ¶
type StateBase struct {
// contains filtered or unexported fields
}
func NewStateBase ¶
func NewStateBase(stateChanged func()) *StateBase
type TapGestureRecognizer ¶
type TapGestureRecognizer interface { GestureRecognizer }
type Timer ¶
type Timer interface { Cancel() Running() bool }
func NewInterval ¶
func NewTimerBackToUI ¶
type TypingEvent ¶
type TypingEventHandler ¶
type TypingEventHandler interface {
OnTypingEvent(event TypingEvent) bool
}
type Widget ¶
type Widget interface {
Info() *WidgetInfo
}
type WidgetBase ¶
type WidgetBase struct {
// contains filtered or unexported fields
}
func NewWidgetBase ¶
func NewWidgetBase(attr Attr) *WidgetBase
func (*WidgetBase) Info ¶
func (me *WidgetBase) Info() *WidgetInfo
type WidgetCreator ¶
type WidgetInfo ¶
type WidgetOutsideShadow ¶
type WidgetOutsideShadow struct {
// contains filtered or unexported fields
}
func NewWidgetOutsideShadow ¶
func NewWidgetOutsideShadow(dataChanged func(), attr Attr) *WidgetOutsideShadow
func (*WidgetOutsideShadow) OutsideShadow ¶
func (me *WidgetOutsideShadow) OutsideShadow() (offsetX, offsetY, radius int32, color Color)
func (*WidgetOutsideShadow) SetOutsideShadow ¶
func (me *WidgetOutsideShadow) SetOutsideShadow(offsetX, offsetY, radius int32, color Color)
type WidgetParent ¶
type WidgetParent struct { *WidgetBase // contains filtered or unexported fields }
func NewWidgetParent ¶
func NewWidgetParent(owner Parent, attr Attr) *WidgetParent
func (*WidgetParent) AddChild ¶
func (me *WidgetParent) AddChild(child ...Widget)
func (*WidgetParent) ChildAt ¶
func (me *WidgetParent) ChildAt(index int) Widget
func (*WidgetParent) Children ¶
func (me *WidgetParent) Children() []Widget
func (*WidgetParent) ChildrenCount ¶
func (me *WidgetParent) ChildrenCount() int
func (*WidgetParent) Find ¶
func (me *WidgetParent) Find(id string) Widget
func (*WidgetParent) GetWidget ¶
func (me *WidgetParent) GetWidget(id string) Widget
func (*WidgetParent) InsertChild ¶
func (me *WidgetParent) InsertChild(index int, child ...Widget)
func (*WidgetParent) RemoveChild ¶
func (me *WidgetParent) RemoveChild(child Widget) int
func (*WidgetParent) RemoveChildAt ¶
func (me *WidgetParent) RemoveChildAt(index int)
func (*WidgetParent) ReplaceChild ¶
func (me *WidgetParent) ReplaceChild(src, dest Widget) int
type WidgetSize ¶
type WidgetSize struct {
// contains filtered or unexported fields
}
func NewWidgetSize ¶
func NewWidgetSize(attr Attr) *WidgetSize
func (*WidgetSize) AddSizeObserver ¶
func (me *WidgetSize) AddSizeObserver(observer func())
func (*WidgetSize) Frame ¶
func (me *WidgetSize) Frame() *Frame
func (*WidgetSize) Height ¶
func (me *WidgetSize) Height() Dimen
func (*WidgetSize) Margin ¶
func (me *WidgetSize) Margin() *Margin
func (*WidgetSize) Padding ¶
func (me *WidgetSize) Padding() *Padding
func (*WidgetSize) RemoveSizeObserver ¶
func (me *WidgetSize) RemoveSizeObserver(observer func())
func (*WidgetSize) ScrollTo ¶
func (me *WidgetSize) ScrollTo(x, y float32)
func (*WidgetSize) ScrollX ¶
func (me *WidgetSize) ScrollX() float32
func (*WidgetSize) ScrollY ¶
func (me *WidgetSize) ScrollY() float32
func (*WidgetSize) SetHeight ¶
func (me *WidgetSize) SetHeight(height Dimen)
func (*WidgetSize) SetMargin ¶
func (me *WidgetSize) SetMargin(margin *Margin)
func (*WidgetSize) SetPadding ¶
func (me *WidgetSize) SetPadding(padding *Padding)
TODO:: why not use value instead ref
func (*WidgetSize) SetScroll ¶
func (me *WidgetSize) SetScroll(x, y float32)
func (*WidgetSize) SetWidth ¶
func (me *WidgetSize) SetWidth(width Dimen)
func (*WidgetSize) Width ¶
func (me *WidgetSize) Width() Dimen
type Window ¶
type Window interface { Component Decor() Widget Title() string SetTitle(string) // Size()(width, height int32) // SetSize(width, height int32) ContentSize() (width, height int32) // Alpha() float32 // SetAlpha(alpha float32) // SetDelegate(delegate WindowDelegate) // Delegate() WindowDelegate Center() Show() // contains filtered or unexported methods }
type WindowEvent ¶
type WindowEvent interface { Event // contains filtered or unexported methods }
WindowEvent
Source Files ¶
- app.go
- app_linux.go
- attribute.go
- canvas.go
- canvas_cairo.go
- canvas_cairo_linux.go
- color.go
- component.go
- const.go
- cursor.go
- cursor_linux.go
- debug_debug.go
- dimen.go
- drawable.go
- event.go
- event_consts.go
- event_handler.go
- filedialog.go
- filedialog_linux.go
- focus.go
- font.go
- font_cairo.go
- gesture_arena.go
- gesture_arena_manager.go
- gesture_consts.go
- gesture_detail.go
- gesture_doubletap.go
- gesture_hittest.go
- gesture_hover.go
- gesture_longpress.go
- gesture_pan.go
- gesture_recognizer.go
- gesture_scale.go
- gesture_scroll.go
- gesture_tap.go
- image.go
- image_cairo.go
- image_svg.go
- inflater.go
- keycode.go
- keycode_linux.go
- lifecycle.go
- manifest.go
- menu.go
- paint.go
- paint_other.go
- parent.go
- path.go
- path_cairo.go
- permission.go
- register.go
- shadow.go
- size.go
- state.go
- theme.go
- timer.go
- use.go
- widget.go
- window.go
- window_linux.go