Documentation ¶
Overview ¶
Package cdapplet is the Cairo-Dock applet base object, using DBus or Gldi backend.
Index ¶
- func Start(callnew cdtype.NewAppletFunc, base *CDApplet) cdtype.AppInstance
- type CDApplet
- func (cda *CDApplet) Action() cdtype.AppAction
- func (cda *CDApplet) Command() cdtype.AppCommand
- func (cda *CDApplet) FileDataDir(filename ...string) string
- func (cda *CDApplet) FileLocation(filename ...string) string
- func (cda *CDApplet) LoadConfig(loadConf bool) (cdtype.Defaults, error)
- func (cda *CDApplet) Log() cdtype.Logger
- func (cda *CDApplet) Name() string
- func (cda *CDApplet) OnEvent(event string, data ...interface{}) (exit bool)
- func (cda *CDApplet) Poller() cdtype.AppPoller
- func (cda *CDApplet) SetBackend(base cdtype.AppBackend)
- func (cda *CDApplet) SetBase(name, conf, rootdir, sharedir string)
- func (cda *CDApplet) SetConfig(confPtr interface{}, actions ...*cdtype.Action)
- func (cda *CDApplet) SetDefaults(def cdtype.Defaults)
- func (cda *CDApplet) SetEvents(app cdtype.AppInstance) func() error
- func (cda *CDApplet) Translate(str string) string
- func (cda *CDApplet) UpdateConfig() (cdtype.ConfUpdater, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Start ¶
func Start(callnew cdtype.NewAppletFunc, base *CDApplet) cdtype.AppInstance
Start starts an instance of the given applet name.
Types ¶
type CDApplet ¶
type CDApplet struct { cdtype.AppIcon // Dock applet connection, Can be Gldi or Dbus (will be Gldi with build tag dock). // contains filtered or unexported fields }
CDApplet is the base Cairo-Dock applet manager that will handle all your communications with the dock and provide some methods commonly needed by applets.
func (*CDApplet) Command ¶
func (cda *CDApplet) Command() cdtype.AppCommand
Command returns a manager of launchable commands for applets
func (*CDApplet) FileDataDir ¶
FileDataDir returns the path to the config root dir (~/.config/cairo-dock).
func (*CDApplet) FileLocation ¶
FileLocation return the full path to a file in the applet data dir.
func (*CDApplet) LoadConfig ¶
LoadConfig will try to create and fill the given config struct with data from the configuration file. Log error and crash if something went wrong. Won't do anything if loadConf is false.
func (*CDApplet) Name ¶
Name returns the applet name as known by the dock. As an external app = dir name.
func (*CDApplet) OnEvent ¶
OnEvent forward the received event to the registered event callback. Return true if the signal was quit applet.
func (*CDApplet) SetBackend ¶
func (cda *CDApplet) SetBackend(base cdtype.AppBackend)
SetBackend sets the applet backend and connects its OnEvent callback to the OnEvent method provided here.
Before After ------------- ------------- | | | |<==\ | -------| | -------| | | | | | | back | | OnEvent | | | | | end |===/ ------------- -------------
func (*CDApplet) SetDefaults ¶
SetDefaults set basic defaults icon settings in one call. Empty fields will be reset, so this is better used in the Init() call.
func (*CDApplet) SetEvents ¶
func (cda *CDApplet) SetEvents(app cdtype.AppInstance) func() error
SetEvents connects events defined by the applet to the dock.
Returns the first init call func.
func (*CDApplet) UpdateConfig ¶
func (cda *CDApplet) UpdateConfig() (cdtype.ConfUpdater, error)
UpdateConfig opens the applet config file for edition.
You must ensure that Save or Cancel is called, and fast to prevent memory leaks and deadlocks.