ibus

package
v0.7.9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 13, 2021 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BUS_DAEMON_NAME     = "org.freedesktop.DBus"
	BUS_DAEMON_PATH     = "/org/freedesktop/DBus"
	BUS_PROPERTIES_NAME = "org.freedesktop.DBus.Properties"

	IBUS_IFACE_IBUS   = "org.freedesktop.IBus"
	IBUS_PATH_IBUS    = "/org/freedesktop/IBus"
	IBUS_SERVICE_IBUS = "org.freedesktop.IBus"

	IBUS_IFACE_PANEL          = "org.freedesktop.IBus.Panel"
	IBUS_IFACE_CONFIG         = "org.freedesktop.IBus.Config"
	IBUS_IFACE_SERVICE        = "org.freedesktop.IBus.Service"
	IBUS_IFACE_ENGINE         = "org.freedesktop.IBus.Engine"
	IBUS_IFACE_ENGINE_FACTORY = "org.freedesktop.IBus.Factory"
	IBUS_IFACE_INPUT_CONTEXT  = "org.freedesktop.IBus.InputContext"
	IBUS_IFACE_NOTIFICATIONS  = "org.freedesktop.IBus.Notifications"

	IBUS_ENGINE_PREEDIT_CLEAR  uint32 = 0
	IBUS_ENGINE_PREEDIT_COMMIT uint32 = 1

	ORIENTATION_HORIZONTAL int32 = 0
	ORIENTATION_VERTICAL   int32 = 1
	ORIENTATION_SYSTEM     int32 = 2

	PROP_TYPE_NORMAL    uint32 = 0
	PROP_TYPE_TOGGLE    uint32 = 1
	PROP_TYPE_RADIO     uint32 = 2
	PROP_TYPE_MENU      uint32 = 3
	PROP_TYPE_SEPARATOR uint32 = 4

	PROP_STATE_UNCHECKED    uint32 = 0
	PROP_STATE_CHECKED      uint32 = 1
	PROP_STATE_INCONSISTENT uint32 = 2

	IBUS_ATTR_TYPE_NONE       uint32 = 0
	IBUS_ATTR_TYPE_UNDERLINE  uint32 = 1
	IBUS_ATTR_TYPE_FOREGROUND uint32 = 2
	IBUS_ATTR_TYPE_BACKGROUND uint32 = 3

	IBUS_ATTR_UNDERLINE_NONE   uint32 = 0
	IBUS_ATTR_UNDERLINE_SINGLE uint32 = 1
	IBUS_ATTR_UNDERLINE_DOUBLE uint32 = 2
	IBUS_ATTR_UNDERLINE_LOW    uint32 = 3
	IBUS_ATTR_UNDERLINE_ERROR  uint32 = 4
)

Variables

This section is empty.

Functions

func GetAddress

func GetAddress() string

func GetLocalMachineId

func GetLocalMachineId() string

func GetSocketPath

func GetSocketPath(useWayland bool) string

func GetUserAuth

func GetUserAuth() []dbus.Auth

func GetUserConfigDir

func GetUserConfigDir() string

func GetWaylandSocketPath added in v0.6.6

func GetWaylandSocketPath(display string) string

func GetX11SocketPath added in v0.6.6

func GetX11SocketPath() string

func PublishEngine

func PublishEngine(conn *dbus.Conn, objectPath dbus.ObjectPath, userEngine interface{})

Types

type AttrList

type AttrList struct {
	Name        string
	Attachments map[string]dbus.Variant
	Attributes  []dbus.Variant
}

type Attribute

type Attribute struct {
	Name        string
	Attachments map[string]dbus.Variant
	Type        uint32
	Value       uint32
	StartIndex  uint32
	EndIndex    uint32
}

func NewAttribute

func NewAttribute(attrType, attrValue, startIndex uint32, endIndex uint32) *Attribute

type Bus

type Bus struct {
	// contains filtered or unexported fields
}

func NewBus

func NewBus() *Bus

func (*Bus) CallMethod

func (bus *Bus) CallMethod(name string, flags dbus.Flags, args ...interface{}) *dbus.Call

func (*Bus) GetDbusConn

func (bus *Bus) GetDbusConn() *dbus.Conn

func (*Bus) RegisterComponent

func (bus *Bus) RegisterComponent(component *Component)

func (*Bus) RequestName

func (bus *Bus) RequestName(name string, flags dbus.RequestNameFlags) (dbus.RequestNameReply, error)

type Component

type Component struct {
	XMLName       xml.Name                `xml:"component" dbus:"-"`
	Name          string                  `xml:"-"`
	Attachments   map[string]dbus.Variant `xml:"-"`
	ComponentName string                  `xml:"name"`
	Description   string                  `xml:"description"`
	Version       string                  `xml:"version"`
	License       string                  `xml:"license"`
	Author        string                  `xml:"author"`
	Homepage      string                  `xml:"homepage"`
	Exec          string                  `xml:"exec"`
	Textdomain    string                  `xml:"textdomain"`
	ObservedPaths []dbus.Variant          `xml:"-"`
	EngineList    []dbus.Variant          `xml:"-"`
	Engines       []*EngineDesc           `xml:"engines>engine" dbus:"-"`
}

func NewComponent

func NewComponent(name string, desc string, version string, license string, author string, homepage string, exec string, textdomain string) *Component

func (*Component) AddEngine

func (c *Component) AddEngine(e *EngineDesc)

func (*Component) OutputXML

func (c *Component) OutputXML(w io.Writer)

type Engine

type Engine struct {
	// contains filtered or unexported fields
}

func BaseEngine

func BaseEngine(conn *dbus.Conn, objectPath dbus.ObjectPath) Engine

func (*Engine) CandidateClicked

func (e *Engine) CandidateClicked(index uint32, button uint32, state uint32) *dbus.Error

@method(in_signature="uuu")

func (*Engine) CommitText

func (e *Engine) CommitText(text *Text)

@signal(signature="v")

func (*Engine) CursorDown

func (e *Engine) CursorDown() *dbus.Error

@method()

func (*Engine) CursorDownLookupTable

func (e *Engine) CursorDownLookupTable()

@signal()

func (*Engine) CursorUp

func (e *Engine) CursorUp() *dbus.Error

@method()

func (*Engine) CursorUpLookupTable

func (e *Engine) CursorUpLookupTable()

@signal()

func (*Engine) DeleteSurroundingText

func (e *Engine) DeleteSurroundingText(offset_from_cursor int32, nchars uint32)

@signal(signature="iu")

func (*Engine) Destroy

func (e *Engine) Destroy() *dbus.Error

@method()

func (*Engine) Disable

func (e *Engine) Disable() *dbus.Error

@method()

func (*Engine) Enable

func (e *Engine) Enable() *dbus.Error

@method()

func (*Engine) FocusIn

func (e *Engine) FocusIn() *dbus.Error

@method()

func (*Engine) FocusOut

func (e *Engine) FocusOut() *dbus.Error

@method()

func (*Engine) ForwardKeyEvent

func (e *Engine) ForwardKeyEvent(keyval uint32, keycode uint32, state uint32)

@signal(signature="uuu")

func (*Engine) GetAll

func (e *Engine) GetAll(iface string) (map[string]dbus.Variant, *dbus.Error)

func (*Engine) HideAuxiliaryText

func (e *Engine) HideAuxiliaryText()

@signal()

func (*Engine) HideLookupTable

func (e *Engine) HideLookupTable()

@signal()

func (*Engine) HidePreeditText

func (e *Engine) HidePreeditText()

@signal()

func (*Engine) PageDown

func (e *Engine) PageDown() *dbus.Error

@method()

func (*Engine) PageDownLookupTable

func (e *Engine) PageDownLookupTable()

@signal()

func (*Engine) PageUp

func (e *Engine) PageUp() *dbus.Error

@method()

func (*Engine) PageUpLookupTable

func (e *Engine) PageUpLookupTable()

@signal()

func (*Engine) ProcessKeyEvent

func (e *Engine) ProcessKeyEvent(keyval uint32, keycode uint32, state uint32) (bool, *dbus.Error)

@method(in_signature="uuu", out_signature="b")

func (*Engine) PropertyActivate

func (e *Engine) PropertyActivate(prop_name string, prop_state uint32) *dbus.Error

@method(in_signature="su")

func (*Engine) PropertyHide

func (e *Engine) PropertyHide(prop_name string) *dbus.Error

@method(in_signature="s")

func (*Engine) PropertyShow

func (e *Engine) PropertyShow(prop_name string) *dbus.Error

@method(in_signature="s")

func (*Engine) RegisterProperties

func (e *Engine) RegisterProperties(props *PropList)

@signal(signature="v")

func (*Engine) RequireSurroundingText

func (e *Engine) RequireSurroundingText()

@signal()

func (*Engine) Reset

func (e *Engine) Reset() *dbus.Error

@method()

func (*Engine) SetCapabilities

func (e *Engine) SetCapabilities(cap uint32) *dbus.Error

@method(in_signature="u")

func (*Engine) SetCursorLocation

func (e *Engine) SetCursorLocation(x int32, y int32, w int32, h int32) *dbus.Error

@method(in_signature="iiii")

func (*Engine) SetSurroundingText

func (e *Engine) SetSurroundingText(text dbus.Variant, cursor_index uint32, anchor_pos uint32) *dbus.Error

@method(in_signature="vuu")

func (*Engine) ShowAuxiliaryText

func (e *Engine) ShowAuxiliaryText()

@signal()

func (*Engine) ShowLookupTable

func (e *Engine) ShowLookupTable()

@signal()

func (*Engine) ShowPreeditText

func (e *Engine) ShowPreeditText()

@signal()

func (*Engine) UpdateAuxiliaryText

func (e *Engine) UpdateAuxiliaryText(text *Text, visible bool)

@signal(signature="vb")

func (*Engine) UpdateLookupTable

func (e *Engine) UpdateLookupTable(lookup_table *LookupTable, visible bool)

@signal(signature="vb")

func (*Engine) UpdatePreeditText

func (e *Engine) UpdatePreeditText(text *Text, cursor_pos uint32, visible bool)

@signal(signature="vubu")

func (*Engine) UpdatePreeditTextWithMode

func (e *Engine) UpdatePreeditTextWithMode(text *Text, cursor_pos uint32, visible bool, mode uint32)

func (*Engine) UpdateProperty

func (e *Engine) UpdateProperty(prop *Property)

@signal(signature="v")

type EngineDesc

type EngineDesc struct {
	Name          string                  `xml:"-"`
	Attachments   map[string]dbus.Variant `xml:"-"`
	EngineName    string                  `xml:"name"`
	LongName      string                  `xml:"longname"`
	Description   string                  `xml:"description"`
	Language      string                  `xml:"language"`
	License       string                  `xml:"license"`
	Author        string                  `xml:"author"`
	Icon          string                  `xml:"icon"`
	Layout        string                  `xml:"layout"`
	Rank          uint32                  `xml:"rank"`
	Hotkeys       string                  `xml:"hotkeys,omitempty"`
	Symbol        string                  `xml:"symbol,omitempty"`
	Setup         string                  `xml:"setup,omitempty"`
	LayoutVariant string                  `xml:"layout-variant,omitempty"`
	LayoutOption  string                  `xml:"layout-option,omitempty"`
	Version       string                  `xml:"version,omitempty"`
	Textdomain    string                  `xml:"textdomain,omitempty"`
}

func FullEngineDesc

func FullEngineDesc(name string, longname string, desc string, lang string, license string, author string, icon string, layout string,
	rank uint32, hotkeys string, symbol string, setup string, layoutVariant string, layoutOption string, version string, textdomain string) *EngineDesc

func SmallEngineDesc

func SmallEngineDesc(name string, longname string, desc string, lang string, license string, author string, icon string, layout string,
	setup string, version string) *EngineDesc

func TinyEngineDesc

func TinyEngineDesc(name string, longname string, desc string, lang string, license string, author string, icon string, layout string) *EngineDesc

type Factory

type Factory struct {
	EngineCreator func(conn *dbus.Conn, engineName string) dbus.ObjectPath
	// contains filtered or unexported fields
}

func NewFactory

func NewFactory(conn *dbus.Conn, EngineCreator func(conn *dbus.Conn, engineName string) dbus.ObjectPath) *Factory

func (*Factory) CreateEngine

func (factory *Factory) CreateEngine(engineName string) (dbus.ObjectPath, *dbus.Error)

# Create an input context and return the id of the context. # If failed, it will return "" or None. @method(in_signature="s", out_signature="o")

func (*Factory) Destroy

func (factory *Factory) Destroy() *dbus.Error

# Destroy the engine @method()

type LookupTable

type LookupTable struct {
	Name          string
	Attachments   map[string]dbus.Variant
	PageSize      uint32
	CursorPos     uint32
	CursorVisible bool
	Round         bool
	Orientation   int32
	Candidates    []dbus.Variant
	Labels        []dbus.Variant
}

func NewLookupTable

func NewLookupTable() *LookupTable

func (*LookupTable) AppendCandidate

func (lt *LookupTable) AppendCandidate(text string)

func (*LookupTable) AppendLabel

func (lt *LookupTable) AppendLabel(label string)

func (*LookupTable) Clean added in v0.3.4

func (lt *LookupTable) Clean()

func (*LookupTable) CursorDown added in v0.3.4

func (lt *LookupTable) CursorDown() bool

func (*LookupTable) CursorUp added in v0.3.4

func (lt *LookupTable) CursorUp() bool

func (*LookupTable) GetCursorPos added in v0.3.4

func (lt *LookupTable) GetCursorPos() uint32

func (*LookupTable) GetCursorPosInCurrentPage added in v0.3.4

func (lt *LookupTable) GetCursorPosInCurrentPage() uint32

func (*LookupTable) PageDown added in v0.3.4

func (lt *LookupTable) PageDown() bool

func (*LookupTable) PageUp added in v0.3.4

func (lt *LookupTable) PageUp() bool

func (*LookupTable) SetCursorPos added in v0.3.4

func (lt *LookupTable) SetCursorPos(pos uint32) bool

func (*LookupTable) SetCursorPosInCurrentPage added in v0.3.4

func (lt *LookupTable) SetCursorPosInCurrentPage(pos uint32) bool

type PropList

type PropList struct {
	Name         string
	Attachments  map[string]dbus.Variant
	PropertyList []dbus.Variant
}

func NewPropList

func NewPropList(propList ...*Property) *PropList

type Property

type Property struct {
	Name        string
	Attachments map[string]dbus.Variant
	Key         string
	Type        uint32
	Label       dbus.Variant
	Icon        string
	Tooltip     dbus.Variant
	Sensitive   bool
	Visible     bool
	State       uint32
	SubProps    dbus.Variant
	Symbol      dbus.Variant
}

func NewProperty

func NewProperty(key string, ptype uint32, label string, icon string, tooltip string, sensitive bool, visible bool, state uint32) *Property

func NewPropertyWithChild

func NewPropertyWithChild(key string, ptype uint32, label string, icon string, tooltip string, sensitive bool, visible bool, state uint32, child PropList) *Property

type Text

type Text struct {
	Name        string
	Attachments map[string]dbus.Variant
	Text        string
	AttrList    dbus.Variant
}

func NewText

func NewText(text string) *Text

func (*Text) AppendAttr

func (t *Text) AppendAttr(attrType, attrValue, startIndex uint32, endIndex uint32)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL