menu

package
v0.0.0-...-ecb45ff Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ToggleTypeCheckmark ToggleType = "checkmark"
	ToggleTypeRadio     ToggleType = "radio"

	DispositionNormal      Disposition = "normal"
	DispositionInformative Disposition = "informative"
	DispositionWarning     Disposition = "warning"
	DispositionAlert       Disposition = "alert"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Disposition

type Disposition string

type Item

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

func NewItem

func NewItem() *Item

func (*Item) Build

func (i *Item) Build() ItemTree

func (*Item) CanBeActivated

func (i *Item) CanBeActivated(b bool) *Item

func (*Item) Disposition

func (i *Item) Disposition(d Disposition) *Item

func (*Item) IconData

func (i *Item) IconData(data []byte) *Item

func (*Item) IconName

func (i *Item) IconName(iconName string) *Item

func (*Item) Label

func (i *Item) Label(label string) *Item

func (*Item) OnClick

func (i *Item) OnClick(fn func()) *Item

func (*Item) Separator

func (i *Item) Separator(b bool) *Item

func (*Item) Shortcut

func (i *Item) Shortcut(shortcut [][]string) *Item

func (*Item) Submenu

func (i *Item) Submenu(children ...*Item) *Item

func (*Item) ToggleState

func (i *Item) ToggleState(onoff bool) *Item

func (*Item) ToggleType

func (i *Item) ToggleType(tt ToggleType) *Item

func (*Item) Visible

func (i *Item) Visible(b bool) *Item

type ItemTree

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

func (ItemTree) ToLayout

func (tree ItemTree) ToLayout() Layout

type Layout

type Layout = struct {
	// V0 is id
	V0 int32
	// V1 is properties
	V1 map[string]dbus.Variant
	// V2 is submenu items
	V2 []dbus.Variant
}
type MenuServer struct {
	*d_bus_menu.UnimplementedDbusmenu
	// contains filtered or unexported fields
}

func NewMenuServer

func NewMenuServer(tree ItemTree) *MenuServer
func (m *MenuServer) AboutToShow(id int32) (needUpdate bool, err *dbus.Error)

AboutToShow is com.canonical.dbusmenu.AboutToShow method.

func (m *MenuServer) AboutToShowGroup(ids []int32) (updatesNeeded, idErrors []int32, err *dbus.Error)

AboutToShowGroup is com.canonical.dbusmenu.AboutToShowGroup method.

func (m *MenuServer) Event(id int32, eventId string, data dbus.Variant, timestamp uint32) (err *dbus.Error)

Event is com.canonical.dbusmenu.Event method.

func (m *MenuServer) EventGroup(events []struct {
	V0 int32
	V1 string
	V2 dbus.Variant
	V3 uint32
},
) (idErrors []int32, err *dbus.Error)

EventGroup is com.canonical.dbusmenu.EventGroup method.

func (m *MenuServer) GetGroupProperties(ids []int32, propertyNames []string) (properties []struct {
	V0 int32
	V1 map[string]dbus.Variant
}, err *dbus.Error,
)

GetGroupProperties is com.canonical.dbusmenu.GetGroupProperties method.

func (m *MenuServer) GetLayout(
	parentId int32,
	recursionDepth int32,
	propertyNames []string,
) (revision uint32, layout Layout, err *dbus.Error)
func (m *MenuServer) GetProperty(id int32, name string) (value dbus.Variant, err *dbus.Error)

GetProperty is com.canonical.dbusmenu.GetProperty method.

type ToggleType

type ToggleType string

Jump to

Keyboard shortcuts

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