Documentation
¶
Overview ¶
Package appdbus is the godock cairo-dock connector using DBus.
Its goal is to connect the cairo-dock applet to its parent, the dock, send actions, and forward events through the backend.
Index ¶
- func StandAlone(callnew cdtype.NewAppletFunc)
- type CDDbus
- func (cda *CDDbus) AddMenuItems(items ...map[string]interface{}) error
- func (cda *CDDbus) AddSubIcon(fields ...string) error
- func (cda *CDDbus) Animate(animation string, rounds int) error
- func (cda *CDDbus) BindShortkey(shortkeys ...*cdtype.Shortkey) error
- func (cda *CDDbus) ConnectEvents(conn *dbus.Conn) (e error)
- func (cda *CDDbus) ConnectToBus() (<-chan *dbus.Signal, error)
- func (cda *CDDbus) DataRenderer() cdtype.IconRenderer
- func (cda *CDDbus) DemandsAttention(start bool, animation string) error
- func (cda *CDDbus) IconProperties() (cdtype.IconProperties, error)
- func (cda *CDDbus) IconProperty() cdtype.IconProperty
- func (cda *CDDbus) OnSignal(s *dbus.Signal) (exit bool)
- func (cda *CDDbus) PopupDialog(data cdtype.DialogData) error
- func (cda *CDDbus) RemoveSubIcon(id string) error
- func (cda *CDDbus) RemoveSubIcons() error
- func (cda *CDDbus) SetEmblem(icon string, position cdtype.EmblemPosition) error
- func (cda *CDDbus) SetIcon(icon string) error
- func (cda *CDDbus) SetLabel(label string) error
- func (cda *CDDbus) SetOnEvent(onEvent func(string, ...interface{}) bool)
- func (cda *CDDbus) SetQuickInfo(info string) error
- func (cda *CDDbus) ShowDialog(message string, duration int) error
- func (cda *CDDbus) SubIcon(key string) cdtype.IconBase
- func (cda *CDDbus) Window() cdtype.IconWindow
- type Menu
- func (menu *Menu) AddCheckEntry(label string, active bool, call interface{}, userData ...interface{}) cdtype.MenuWidgeter
- func (menu *Menu) AddEntry(label, iconPath string, call interface{}, userData ...interface{}) cdtype.MenuWidgeter
- func (menu *Menu) AddRadioEntry(label string, active bool, group int, call interface{}, ...) cdtype.MenuWidgeter
- func (menu *Menu) AddSeparator()
- func (menu *Menu) AddSubMenu(label, iconPath string) cdtype.Menuer
- func (menu *Menu) Clear()
- func (menu *Menu) Launch(id int32)
- type MenuData
- type SubIcon
- func (cdi *SubIcon) Animate(animation string, rounds int) error
- func (cdi *SubIcon) SetEmblem(icon string, position cdtype.EmblemPosition) error
- func (cdi *SubIcon) SetIcon(icon string) error
- func (cdi *SubIcon) SetLabel(label string) error
- func (cdi *SubIcon) SetQuickInfo(info string) error
- func (cdi *SubIcon) ShowDialog(message string, duration int) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func StandAlone ¶
func StandAlone(callnew cdtype.NewAppletFunc)
StandAlone will create, prepare and launch a standalone cairo-dock applet.
If you set your events at creation, they will respond when needed, and you have nothing more to worry about your applet management.
It can handle only one poller for now.
If a fatal error is received during one of those steps, the applet will not be started and errors should be logged. Can't do much more about it.
Types ¶
type CDDbus ¶
type CDDbus struct {
// contains filtered or unexported fields
}
CDDbus is an applet connection to Cairo-Dock using Dbus.
func New ¶
func New(callnew cdtype.NewAppletFunc, args []string, dir string) (cdtype.AppInstance, *CDDbus, func() error)
New creates a new applet instance with args from command line.
func (*CDDbus) AddMenuItems ¶
AddMenuItems adds a list of items to the menu triggered by OnBuildMenu.
func (*CDDbus) AddSubIcon ¶
AddSubIcon adds subicons by pack of 3 strings : label, icon, id.
func (*CDDbus) BindShortkey ¶
BindShortkey binds one or more keyboard shortcuts to your applet.
func (*CDDbus) ConnectEvents ¶
ConnectEvents registers to receive Dbus applet events.
func (*CDDbus) ConnectToBus ¶
ConnectToBus connects the applet manager to the dock and register events callbacks.
func (*CDDbus) DataRenderer ¶
func (cda *CDDbus) DataRenderer() cdtype.IconRenderer
DataRenderer manages the graphic data renderer of the icon.
func (*CDDbus) DemandsAttention ¶
DemandsAttention is an endless Animate method.
func (*CDDbus) IconProperties ¶
func (cda *CDDbus) IconProperties() (cdtype.IconProperties, error)
IconProperties returns all applet icon properties at once.
func (*CDDbus) IconProperty ¶
func (cda *CDDbus) IconProperty() cdtype.IconProperty
IconProperty returns applet icon properties one by one.
func (*CDDbus) OnSignal ¶
OnSignal forward the received signal to the registered event callback. Return true if the signal was quit applet.
func (*CDDbus) PopupDialog ¶
func (cda *CDDbus) PopupDialog(data cdtype.DialogData) error
PopupDialog open a dialog box . See cdtype.AppIcon.
func (*CDDbus) RemoveSubIcon ¶
RemoveSubIcon only need the ID to remove the SubIcon.
func (*CDDbus) RemoveSubIcons ¶
RemoveSubIcons removes all subicons from the applet. (To be called in init).
func (*CDDbus) SetEmblem ¶
func (cda *CDDbus) SetEmblem(icon string, position cdtype.EmblemPosition) error
SetEmblem set an emblem image on the icon. To remove it, you have to use SetEmblem again with an empty string.
func (*CDDbus) SetOnEvent ¶
SetOnEvent sets the OnEvent callback to forwards events.
func (*CDDbus) SetQuickInfo ¶
SetQuickInfo change the quickinfo text displayed on the icon.
func (*CDDbus) ShowDialog ¶
ShowDialog pops up a simple dialog bubble on the icon.
func (*CDDbus) Window ¶
func (cda *CDDbus) Window() cdtype.IconWindow
Window gives access to actions on the controlled window.
type Menu ¶
Menu is a menu builder, storing callbacks at creation to be sure the answer match the user request.
func (*Menu) AddCheckEntry ¶
func (menu *Menu) AddCheckEntry(label string, active bool, call interface{}, userData ...interface{}) cdtype.MenuWidgeter
AddCheckEntry adds a check entry to the menu.
func (*Menu) AddEntry ¶
func (menu *Menu) AddEntry(label, iconPath string, call interface{}, userData ...interface{}) cdtype.MenuWidgeter
AddEntry adds an item to the menu with its callback.
func (*Menu) AddRadioEntry ¶
func (menu *Menu) AddRadioEntry(label string, active bool, group int, call interface{}, userData ...interface{}) cdtype.MenuWidgeter
AddRadioEntry adds a radio entry to the menu.
func (*Menu) AddSeparator ¶
func (menu *Menu) AddSeparator()
AddSeparator adds a separator to the menu.
func (*Menu) AddSubMenu ¶
AddSubMenu adds a submenu to the menu.
TODO: test if first entry (ID=0) really can't be a submenu.
type MenuData ¶
type MenuData struct {
// contains filtered or unexported fields
}
MenuData stores the menu data to send, and callbacks to launch on return.
type SubIcon ¶
type SubIcon struct {
// contains filtered or unexported fields
}
SubIcon defines a connection to the subdock icon.
func (*SubIcon) Animate ¶
Animate animates the subicon, with a given animation and for a given number of rounds. See Icon.
func (*SubIcon) SetEmblem ¶
func (cdi *SubIcon) SetEmblem(icon string, position cdtype.EmblemPosition) error
SetEmblem set an emblem image on the subicon. See Icon.
func (*SubIcon) SetIcon ¶
SetIcon set the image of the subicon, overwriting the previous one. See Icon.
func (*SubIcon) SetQuickInfo ¶
SetQuickInfo change the quickinfo text displayed on the subicon.