gldi

package
v0.0.0-...-0caaa62 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2017 License: GPL-3.0-or-later Imports: 21 Imported by: 0

Documentation

Overview

Package gldi provides Go bindings for gldi (cairo-dock). Supports version 3.4

Index

Constants

View Source
const IconLastOrder = -1e9 // CAIRO_DOCK_LAST_ORDER

IconLastOrder defines the last icon position ??

Variables

View Source
var Crypto cdglobal.Crypto = crypto{}

Crypto gives access to the dock string crypto.

Functions

func CIntPointer

func CIntPointer(i int) C.gpointer

CIntPointer returns a C gpointer to an int value.

func CanSetOnWidgetLayer

func CanSetOnWidgetLayer() bool

CanSetOnWidgetLayer returns whether desklets can be set on the widget layer.

func ConfFileNeedUpdate

func ConfFileNeedUpdate(kf *keyfile.KeyFile, version string) bool

ConfFileNeedUpdate returns whether the config file needs update or not.

func ConfFileUpgrade

func ConfFileUpgrade(current, original string, updateKeys bool) error

ConfFileUpgrade upgrades a config file (copy from default and reapply keys).

func CurrentThemeExport

func CurrentThemeExport(themeName string, saveBehaviour, saveLaunchers bool) error

CurrentThemeExport loads the theme in the dock.

func CurrentThemeImport

func CurrentThemeImport(themeName string, useBehaviour, useLaunchers bool) error

CurrentThemeImport loads the theme in the dock.

func CurrentThemeLoad

func CurrentThemeLoad()

CurrentThemeLoad loads the theme in the dock.

func CurrentThemeNeedSave

func CurrentThemeNeedSave() bool

CurrentThemeNeedSave loads the theme in the dock.

func CurrentThemePackage

func CurrentThemePackage(themeName, dirPath string) error

CurrentThemePackage creates a package with the current theme of the dock.

func DbusGThreadInit

func DbusGThreadInit()

DbusGThreadInit inits C threads.

func DisableContainersOpacity

func DisableContainersOpacity()

DisableContainersOpacity disables the opacity ability on containers.

func DockAddConfFile

func DockAddConfFile() string

DockAddConfFile adds a config file for a new root dock. Does not create the dock (use gldi_dock_new for that). Returns the unique name for the new dock, to be passed to gldi_dock_new.

func DockIsLoading

func DockIsLoading() bool

DockIsLoading returns whether the dock is still loading or not.

func EmitSignalDropData

func EmitSignalDropData(container *Container, data string, icon Icon, order float64)

EmitSignalDropData emits the signal on the container.

func FMForceDeskEnv

func FMForceDeskEnv(env cdglobal.DeskEnvironment)

FMForceDeskEnv forces the dock to use the given desktop environment backend.

func ForceDocksAbove

func ForceDocksAbove()

ForceDocksAbove forces all docks to appear on top of other windows.

func FreeAll

func FreeAll()

FreeAll frees all C dock memory.

func GLBackendDeactivate

func GLBackendDeactivate()

GLBackendDeactivate prevents the dock from activating the OpenGL backend.

func GLBackendForceIndirectRendering

func GLBackendForceIndirectRendering()

GLBackendForceIndirectRendering forces the indirect rendering on the OpenGL backend.

func GLBackendIsSafe

func GLBackendIsSafe() bool

GLBackendIsSafe returns whether the OpenGL backend is safely usable or not.

func GLBackendIsUsed

func GLBackendIsUsed() bool

GLBackendIsUsed returns whether the dock use OpenGL backend or not.

func Init

func Init(rendering RenderingMethod)

Init initialises the gldi backend with the rendering method provided.

func LockGTK

func LockGTK()

LockGTK runs the gtk main loop. Use to lock the dock main thread.

func LogForceUseColor

func LogForceUseColor()

LogForceUseColor sets the colored output for the C dock debug.

func LogSetLevelFromName

func LogSetLevelFromName(verbosity string)

LogSetLevelFromName sets the C dock debug level.

func ManagerReload

func ManagerReload(name string, b bool, keyf *keyfile.KeyFile)

ManagerReload reloads the manager matching the given name.

func MenuAddItem(menu *gtk.Menu, label, iconPath string) *gtk.MenuItem

MenuAddItem adds an item to the menu.

func MenuAddSubMenu(menu *gtk.Menu, label, iconPath string) (*gtk.Menu, *gtk.MenuItem)

MenuAddSubMenu adds a sub-menu to a given menu.

func ModulesGetNb

func ModulesGetNb() int

ModulesGetNb returns the number of internal modules defined.

func ModulesNewFromDirectory

func ModulesNewFromDirectory(dir string) error

ModulesNewFromDirectory loads internal modules from the given directory. Use with an empty dir to load from the default directory.

func ObjectDelete

func ObjectDelete(obj IObject)

ObjectDelete deletes the given object.

func ObjectIsDock

func ObjectIsDock(obj IObject) bool

ObjectIsDock returns whether the given object is a dock or not.

func ObjectIsManagerChild

func ObjectIsManagerChild(obj IObject, ptr *C.GldiObjectManager) bool

ObjectIsManagerChild returns whether the given object is a manager child.

func ObjectNotify

func ObjectNotify(container *Container, notif int, icon Icon, dock *CairoDock, key gdk.ModifierType)

ObjectNotify notifies the given object.

func ObjectReload

func ObjectReload(obj IObject)

ObjectReload reloads the given object.

func ObjectUnref

func ObjectUnref(obj IObject)

ObjectUnref unrefs the given object.

func QuickHideAllDocks

func QuickHideAllDocks()

QuickHideAllDocks hides all dock at once.

func SetContainersNonSticky

func SetContainersNonSticky()

SetContainersNonSticky sets the non sticky mode for containers.

func SetPaths

func SetPaths(dataDir, extra, themes, current, shareTheme, distantTheme, serverTheme string)

SetPaths sets the default paths for the gldi backend.

func StyleColorsFreeze

func StyleColorsFreeze()

StyleColorsFreeze TODO FIND USAGE.

func XMLCleanupParser

func XMLCleanupParser()

XMLCleanupParser TODO FIND USAGE.

Types

type Animation

type Animation struct {
	Ptr *C.CairoDockAnimationRecord
}

Animation defines a dock animation.

func NewAnimationFromNative

func NewAnimationFromNative(p unsafe.Pointer) *Animation

NewAnimationFromNative wraps a dock animation from C pointer.

func (*Animation) GetDisplayedName

func (dr *Animation) GetDisplayedName() string

GetDisplayedName returns the animation displayed name.

type CairoDeskletDecoration

type CairoDeskletDecoration struct {
	Ptr *C.CairoDeskletDecoration
}

CairoDeskletDecoration defines a dock desklet decoration.

func NewCairoDeskletDecorationFromNative

func NewCairoDeskletDecorationFromNative(p unsafe.Pointer) *CairoDeskletDecoration

NewCairoDeskletDecorationFromNative wraps a dock desklet decoration from C pointer.

func (*CairoDeskletDecoration) GetDisplayedName

func (dr *CairoDeskletDecoration) GetDisplayedName() string

GetDisplayedName returns the desklet decoration displayed name.

type CairoDock

type CairoDock struct {
	Ptr          *C.CairoDock
	RendererData interface{} // View rendering data.
}

CairoDock defines a gldi dock.

func DockGet

func DockGet(containerName string) *CairoDock

DockGet returns the dock with the given name.

func DockNew

func DockNew(name string) *CairoDock

DockNew creates a new dock with the given name.

func GetAllAvailableDocks

func GetAllAvailableDocks(parent, subdock *CairoDock) []*CairoDock

GetAllAvailableDocks returns a filtered list of docks.

pParentDock    if not nil: exclude this dock.
pSubDock       if not nil: exclude this dock and its children.

func NewDockFromNative

func NewDockFromNative(p unsafe.Pointer) *CairoDock

NewDockFromNative wraps a gldi dock from C pointer.

func (*CairoDock) Align

func (o *CairoDock) Align() float64

Align returns the dock alignment (left/right or top/bottom).

func (*CairoDock) BackgroundBufferTexture

func (o *CairoDock) BackgroundBufferTexture() uint32

BackgroundBufferTexture TODO FIND USAGE.

func (*CairoDock) CalculateMagnitude

func (o *CairoDock) CalculateMagnitude() float64

CalculateMagnitude calculates the dock magnitude.

func (*CairoDock) CheckCanDropLinear

func (o *CairoDock) CheckCanDropLinear()

CheckCanDropLinear checks if we can drop linear. TODO CHECK USAGE.

func (*CairoDock) CheckIfMouseInsideLinear

func (o *CairoDock) CheckIfMouseInsideLinear()

CheckIfMouseInsideLinear checks if the mouse is inside the linear area.

func (*CairoDock) Container

func (o *CairoDock) Container() *Container

Container returns the inside container ?? TODO ENSURE.

func (*CairoDock) DecorationsHeight

func (o *CairoDock) DecorationsHeight() int

DecorationsHeight returns the dock decorations height.

func (*CairoDock) FirstDrawnElementLinear

func (o *CairoDock) FirstDrawnElementLinear() []Icon

FirstDrawnElementLinear TODO FIND USAGE.

func (*CairoDock) GetCurrentWidthLinear

func (o *CairoDock) GetCurrentWidthLinear() float64

GetCurrentWidthLinear returns the dock current width linear.

func (*CairoDock) GetDockName

func (o *CairoDock) GetDockName() string

GetDockName returns the key name of the dock.

func (*CairoDock) GetNextIcon

func (o *CairoDock) GetNextIcon(icon Icon) Icon

GetNextIcon returns the icon after the given one in the dock.

func (*CairoDock) GetPointedIcon

func (o *CairoDock) GetPointedIcon() Icon

GetPointedIcon returns the pointed icon (mouse on the icon).

func (*CairoDock) GetPreviousIcon

func (o *CairoDock) GetPreviousIcon(icon Icon) Icon

GetPreviousIcon returns the icon before the given one in the dock.

func (*CairoDock) GetReadableName

func (o *CairoDock) GetReadableName() string

GetReadableName returns the readable name of the dock.

func (*CairoDock) GetRefCount

func (o *CairoDock) GetRefCount() int

GetRefCount gives the number of icons pointing on the dock. 0 means it is a root dock, >0 a sub-dock.

func (*CairoDock) GlobalIconSize

func (o *CairoDock) GlobalIconSize() bool

GlobalIconSize returns the global icon size.

func (*CairoDock) HasShapeBitmap

func (o *CairoDock) HasShapeBitmap() bool

HasShapeBitmap returns whether the dock has shape bitmap.

func (*CairoDock) IconSize

func (o *CairoDock) IconSize() int

IconSize returns the dock icon size.

func (*CairoDock) Icons

func (o *CairoDock) Icons() (list []Icon)

Icons returns the list of icons in the dock.

func (*CairoDock) IsAutoHide

func (o *CairoDock) IsAutoHide() bool

IsAutoHide returns whether the dock was auto hidden (TODO ensure).

func (*CairoDock) IsExtendedDock

func (o *CairoDock) IsExtendedDock() bool

IsExtendedDock returns whether the dock is extended.

func (*CairoDock) IsMainDock

func (o *CairoDock) IsMainDock() bool

IsMainDock returns whether the dock is a main dock or not.

func (*CairoDock) MaxDockHeight

func (o *CairoDock) MaxDockHeight() int

MaxDockHeight returns the max dock height.

func (*CairoDock) MaxDockWidth

func (o *CairoDock) MaxDockWidth() int

MaxDockWidth returns the max dock width.

func (*CairoDock) MaxIconHeight

func (o *CairoDock) MaxIconHeight() int

MaxIconHeight returns the max icon height.

func (*CairoDock) MinDockHeight

func (o *CairoDock) MinDockHeight() int

MinDockHeight returns the min dock height.

func (*CairoDock) MinDockWidth

func (o *CairoDock) MinDockWidth() int

MinDockWidth returns the min dock width.

func (*CairoDock) ScreenNumber

func (o *CairoDock) ScreenNumber() int

ScreenNumber TODO FIND USAGE.

func (*CairoDock) ScreenWidth

func (o *CairoDock) ScreenWidth() int

ScreenWidth returns the dock allocated screen width.

cairo_dock_get_max_authorized_dock_width

func (*CairoDock) SearchIconPointingOnDock

func (o *CairoDock) SearchIconPointingOnDock(unknown interface{}) Icon

SearchIconPointingOnDock TODO FIND USAGE AND COMPLETE.

func (*CairoDock) SetActiveHeight

func (o *CairoDock) SetActiveHeight(val int)

SetActiveHeight sets the dock active height.

func (*CairoDock) SetActiveWidth

func (o *CairoDock) SetActiveWidth(val int)

SetActiveWidth sets the dock active width.

func (*CairoDock) SetDecorationsHeight

func (o *CairoDock) SetDecorationsHeight(i int)

SetDecorationsHeight sets decorations height.

func (*CairoDock) SetDecorationsWidth

func (o *CairoDock) SetDecorationsWidth(val int)

SetDecorationsWidth sets decorations width.

func (*CairoDock) SetFlatDockWidth

func (o *CairoDock) SetFlatDockWidth(val float64)

SetFlatDockWidth sets the dock flat width.

func (*CairoDock) SetMagnitudeMax

func (o *CairoDock) SetMagnitudeMax(val float64)

SetMagnitudeMax sets the max dock magnitude.

func (*CairoDock) SetMaxDockHeight

func (o *CairoDock) SetMaxDockHeight(val int)

SetMaxDockHeight sets the dock max height.

func (*CairoDock) SetMaxDockWidth

func (o *CairoDock) SetMaxDockWidth(val int)

SetMaxDockWidth sets the max dock width.

func (*CairoDock) SetMinDockHeight

func (o *CairoDock) SetMinDockHeight(val int)

SetMinDockHeight sets the dock min height.

func (*CairoDock) SetMinDockWidth

func (o *CairoDock) SetMinDockWidth(val int)

SetMinDockWidth sets the min dock width.

func (*CairoDock) ShapeBitmapSubstractRectangleInt

func (o *CairoDock) ShapeBitmapSubstractRectangleInt(x, y, w, h int)

ShapeBitmapSubstractRectangleInt TODO FIND USAGE

func (*CairoDock) ToContainer

func (o *CairoDock) ToContainer() *Container

ToContainer returns the dock as a Container object.

func (*CairoDock) ToNative

func (o *CairoDock) ToNative() unsafe.Pointer

ToNative returns the pointer to the native object.

type CairoDockRenderer

type CairoDockRenderer struct {
	Ptr *C.CairoDockRenderer
}

CairoDockRenderer defines a dock renderer, AKA views.

func NewCairoDockRenderer

func NewCairoDockRenderer(title, readmePath, previewPath string) *CairoDockRenderer

NewCairoDockRenderer creates a new dock renderer.

func NewCairoDockRendererFromNative

func NewCairoDockRendererFromNative(p unsafe.Pointer) *CairoDockRenderer

NewCairoDockRendererFromNative wraps a dock renderer from C pointer.

func (*CairoDockRenderer) GetDisplayedName

func (dr *CairoDockRenderer) GetDisplayedName() string

GetDisplayedName returns the dock renderer displayed name.

func (*CairoDockRenderer) GetPreviewFilePath

func (dr *CairoDockRenderer) GetPreviewFilePath() string

GetPreviewFilePath returns the dock renderer preview file path.

func (*CairoDockRenderer) GetReadmeFilePath

func (dr *CairoDockRenderer) GetReadmeFilePath() string

GetReadmeFilePath returns the dock renderer readme file path.

func (*CairoDockRenderer) Register

func (dr *CairoDockRenderer) Register(name string)

Register registers the dock renderer in the dock.

func (*CairoDockRenderer) ToNative

func (dr *CairoDockRenderer) ToNative() unsafe.Pointer

ToNative returns the pointer to the native object.

type Container

type Container struct {
	Ptr *C.GldiContainer
}

Container defines a gldi container.

func NewContainerFromNative

func NewContainerFromNative(p unsafe.Pointer) *Container

NewContainerFromNative wraps a gldi container from C pointer.

func (*Container) Height

func (o *Container) Height() int

Height returns the container height.

func (*Container) IsDesklet

func (o *Container) IsDesklet() bool

IsDesklet returns whether the container is a desklet or not.

func (*Container) IsDialog

func (o *Container) IsDialog() bool

IsDialog returns whether the container is a dialog or not.

func (*Container) IsDirectionUp

func (o *Container) IsDirectionUp() bool

IsDirectionUp returns if the dock is positioned on top or bottom.

func (*Container) IsFlyingContainer

func (o *Container) IsFlyingContainer() bool

IsFlyingContainer returns whether the container is a flying container or not.

func (*Container) IsHorizontal

func (o *Container) IsHorizontal() bool

IsHorizontal returns if the container orientation is horizontal.

func (*Container) MouseX

func (o *Container) MouseX() int

MouseX returns the mouse horizontal position on the container.

func (*Container) MouseY

func (o *Container) MouseY() int

MouseY returns the mouse vertical position on the container.

func (*Container) Ratio

func (o *Container) Ratio() float64

Ratio returns the container ratio.

func (*Container) ScreenBorder

func (o *Container) ScreenBorder() cdtype.ContainerPosition

ScreenBorder returns the border of the screen where the dock is attached.

func (*Container) ToCairoDock

func (o *Container) ToCairoDock() *CairoDock

ToCairoDock returns the container as a dock if possible.

func (*Container) ToDesklet

func (o *Container) ToDesklet() *Desklet

ToDesklet returns the container as a desklet if possible.

func (*Container) ToNative

func (o *Container) ToNative() unsafe.Pointer

ToNative returns the pointer to the native object.

func (*Container) Type

func (o *Container) Type() cdtype.ContainerType

Type returns the type of container.

func (*Container) Width

func (o *Container) Width() int

Width returns the container width.

func (*Container) WindowPositionX

func (o *Container) WindowPositionX() int

WindowPositionX TODO usage.

func (*Container) WindowPositionY

func (o *Container) WindowPositionY() int

WindowPositionY TODO usage.

type DataRendererAttributeCommon

type DataRendererAttributeCommon struct {
	ModelName    string
	LatencyTime  int
	NbValues     int
	WriteValues  bool
	UpdateMinMax bool // for graph
	MemorySize   int  // for graph
	RotateTheme  int  // for gauge
	// contains filtered or unexported fields
}

DataRendererAttributeCommon defines the base for a data renderer attribute.

func (*DataRendererAttributeCommon) Free

func (o *DataRendererAttributeCommon) Free()

Free frees the renderer object.

type DataRendererAttributeGauge

type DataRendererAttributeGauge struct {
	DataRendererAttributeCommon
	Theme string
}

DataRendererAttributeGauge defines a gauge data renderer attribute.

func NewDataRendererAttributeGauge

func NewDataRendererAttributeGauge() *DataRendererAttributeGauge

NewDataRendererAttributeGauge creates a gauge data renderer attribute.

func (*DataRendererAttributeGauge) ToAttribute

func (o *DataRendererAttributeGauge) ToAttribute() (*C.CairoDataRendererAttribute, func())

ToAttribute converts the renderer to C attribute.

type DataRendererAttributeGraph

type DataRendererAttributeGraph struct {
	DataRendererAttributeCommon
	Type            cdtype.RendererGraphType
	MixGraphs       bool
	HighColor       []float64
	LowColor        []float64
	BackGroundColor [4]float64
}

DataRendererAttributeGraph defines a graph data renderer attribute.

func NewDataRendererAttributeGraph

func NewDataRendererAttributeGraph() *DataRendererAttributeGraph

NewDataRendererAttributeGraph creates a graph data renderer attribute.

func (*DataRendererAttributeGraph) ToAttribute

func (o *DataRendererAttributeGraph) ToAttribute() (*C.CairoDataRendererAttribute, func())

ToAttribute converts the renderer to C attribute.

type DataRendererAttributeProgressBar

type DataRendererAttributeProgressBar struct {
	DataRendererAttributeCommon
}

DataRendererAttributeProgressBar defines a progress bar data renderer attribute.

func NewDataRendererAttributeProgressBar

func NewDataRendererAttributeProgressBar() *DataRendererAttributeProgressBar

NewDataRendererAttributeProgressBar creates a progress bar data renderer attribute.

func (*DataRendererAttributeProgressBar) ToAttribute

ToAttribute converts the renderer to C attribute.

type DataRendererAttributer

type DataRendererAttributer interface {
	ToAttribute() (attr *C.CairoDataRendererAttribute, free func())
}

DataRendererAttributer defines the data renderer attribute interface.

type DataRendererTextFunc

type DataRendererTextFunc func(...float64) []string

DataRendererTextFunc defines a data renderer text format func.

type Desklet

type Desklet struct {
	Ptr *C.CairoDesklet
}

Desklet defines a gldi desklet.

func NewDeskletFromNative

func NewDeskletFromNative(p unsafe.Pointer) *Desklet

NewDeskletFromNative wraps a gldi desklet from C pointer.

func (*Desklet) GetIcon

func (o *Desklet) GetIcon() Icon

GetIcon gets the icon behind the desklet.

func (*Desklet) HasIcons

func (o *Desklet) HasIcons() bool

HasIcons returns whether the desklet has icons or not.

func (*Desklet) Icons

func (o *Desklet) Icons() []Icon

Icons returns the list of icons in the desklet.

func (*Desklet) IsSticky

func (o *Desklet) IsSticky() bool

IsSticky returns whether the desklet is sticky.

func (*Desklet) LockPosition

func (o *Desklet) LockPosition(b bool)

LockPosition sets the locked position state.

func (*Desklet) PositionLocked

func (o *Desklet) PositionLocked() bool

PositionLocked gets the locked position state.

func (*Desklet) RemoveIcons

func (o *Desklet) RemoveIcons()

RemoveIcons removes icons from the desklet.

func (*Desklet) SetRendererByName

func (o *Desklet) SetRendererByName(name string)

SetRendererByName sets the desklet renderer.

func (*Desklet) SetRendererByNameData

func (o *Desklet) SetRendererByNameData(name string, unk1, unk2 bool)

SetRendererByNameData sets the desklet renderer with TODO usage.

func (*Desklet) SetSticky

func (o *Desklet) SetSticky(b bool)

SetSticky sets the desklet sticky state.

func (*Desklet) SetVisibility

func (o *Desklet) SetVisibility(vis cdtype.DeskletVisibility, save bool)

SetVisibility sets the desklet visibility. Can save to conf file.

func (*Desklet) ToNative

func (o *Desklet) ToNative() unsafe.Pointer

ToNative returns the pointer to the native object.

func (*Desklet) Visibility

func (o *Desklet) Visibility() cdtype.DeskletVisibility

Visibility gets the desklet visibility state.

type DialogDecorator

type DialogDecorator struct {
	Ptr *C.CairoDialogDecorator
}

DialogDecorator defines a dock dialog decorator.

func NewDialogDecoratorFromNative

func NewDialogDecoratorFromNative(p unsafe.Pointer) *DialogDecorator

NewDialogDecoratorFromNative wraps a dock dialog decorator from C pointer.

func (*DialogDecorator) GetDisplayedName

func (dr *DialogDecorator) GetDisplayedName() string

GetDisplayedName returns the dialog decorator displayed name.

type IObject

type IObject interface {
	ToNative() unsafe.Pointer
}

IObject represents a basic dock object.

type Icon

type Icon interface {

	// ToNative returns the pointer to the native object.
	//
	ToNative() unsafe.Pointer

	// DefaultNameIcon returns improved name and image for the icon if possible.
	//
	DefaultNameIcon() (name, img string)
	HasClass() bool
	GetClass() desktopclass.Info
	GetName() string
	GetInitialName() string
	GetFileName() string
	GetDesktopFileName() string
	GetParentDockName() string
	GetCommand() string
	GetContainer() *Container

	// ConfigPath gives the full path to the icon config file.
	//
	ConfigPath() string
	GetIgnoreQuickList() bool

	X() float64
	Y() float64
	DrawX() float64
	DrawY() float64
	Width() float64
	Height() float64
	RequestedWidth() int
	RequestedHeight() int
	RequestedDisplayWidth() int
	RequestedDisplayHeight() int
	IsPointed() bool
	SetPointed(val bool)
	SetWidth(val float64)

	SetHeight(val float64)
	SetScale(val float64)
	InsertRemoveFactor() float64
	Scale() float64
	XAtRest() float64
	SetX(f float64)
	SetY(f float64)
	SetDrawX(f float64)
	SetDrawY(f float64)
	SetXAtRest(f float64)
	SetAllocatedSize(w, h int)
	SetWidthFactor(f float64)
	SetHeightFactor(f float64)
	SetOrientation(f float64)
	SetAlpha(f float64)
	Order() float64
	IconExtent() (int, int)
	IsApplet() bool

	// IsAppli returns whether the icon manages an application. CAIRO_DOCK_IS_APPLI
	//
	IsAppli() bool

	// IsClassIcon returns whether the icon .
	// GLDI_OBJECT_IS_CLASS_ICON / CAIRO_DOCK_ICON_TYPE_IS_CLASS_CONTAINER
	//
	IsClassIcon() bool

	//
	IsDetachableApplet() bool

	// IsMultiAppli returns whether the icon manages multiple applications. CAIRO_DOCK_IS_MULTI_APPLI
	//
	IsMultiAppli() bool

	// IsTaskbar returns whether the icon belongs to the taskbar or not.
	//
	IsTaskbar() bool
	IsSeparator() bool
	IsSeparatorAuto() bool
	IsLauncher() bool
	IsStackIcon() bool // CAIRO_DOCK_ICON_TYPE_IS_CONTAINER

	RemoveFromDock()
	WriteContainerNameInConfFile(newdock string)
	ModuleInstance() *ModuleInstance
	GetSubDock() *CairoDock

	// SubDockIsVisible returns whether the subdock is visible or not.
	//
	SubDockIsVisible() bool
	RemoveSubdockEmpty()

	// LaunchCommand starts the command associated with the icon.
	//
	LaunchCommand(log cdtype.Logger, args ...string) bool

	// ShowSubdock shows the icon subdock.
	//
	ShowSubdock(parentDock *CairoDock)

	// DesktopPresentClass can use scale applet to show class windows.
	//
	DesktopPresentClass() bool

	RemoveDialogs()

	IsDemandingAttention() bool

	RequestAttention(animation string, nbRounds int)

	StopAttention()

	ClassIsInhibited() bool

	InhibiteClass(class string)

	DeinhibiteClass()

	Window() cdglobal.Window

	// GetInhibitor returns the icon that inhibits the current one (has registered the class).
	//
	GetInhibitor(b bool) Icon

	RemoveIconsFromSubdock(dest *CairoDock)

	// TODO: may have to move.
	SubDockIcons() []Icon

	// SetLabel sets the label of an icon.
	// If it has a sub-dock, it is renamed (the name is possibly altered to stay unique).
	// The label buffer is updated too.
	//
	SetLabel(str string)

	// SetQuickInfo sets the quick-info of an icon.
	// This is a small text (a few characters) that is superimposed on the icon.
	//
	SetQuickInfo(str string)

	SetIcon(str string) error

	AddNewDataRenderer(attr DataRendererAttributer)

	AddDataRendererWithText(attr DataRendererAttributer, dataRendererText DataRendererTextFunc)

	Render(values ...float64) error

	DataRendererTextFuncPercent(values ...float64) []string

	RemoveDataRenderer()

	// AddOverlayFromImage adds an overlay on the icon.
	//
	AddOverlayFromImage(iconPath string, position cdtype.EmblemPosition)

	// RemoveOverlayAtPosition removes an overlay on the icon.
	//
	RemoveOverlayAtPosition(position cdtype.EmblemPosition)

	RequestAnimation(animation string, rounds int)

	Redraw()

	// MoveAfterIcon moves the icon position after the given icon.
	//
	MoveAfterIcon(container *CairoDock, target Icon)

	// CallbackActionWindow returns a func to use as gtk callback.
	// On event, it will test if the icon still has a valid window and launch the
	// provided action on this window.
	//
	CallbackActionWindow(call func(cdglobal.Window)) func()

	// CallbackActionSubWindows is the same as CallbackActionWindow but launch the
	// action on all subdock windows.
	//
	CallbackActionSubWindows(call func(cdglobal.Window)) func()

	CallbackActionWindowToggle(call func(cdglobal.Window, bool), getvalue func(cdglobal.Window) bool) func()

	GetPrevNextClassMateIcon(next bool) Icon
}

Icon defines the dock icon interface.

func CreateDummyLauncher

func CreateDummyLauncher(name, iconPath, command, quickinfo string, order float64) Icon

CreateDummyLauncher creates an empty icon.

func GetAppliIcon

func GetAppliIcon(win cdglobal.Window) Icon

GetAppliIcon returns the icon managing the window.

func IconsGetAnyWithoutDialog

func IconsGetAnyWithoutDialog() Icon

IconsGetAnyWithoutDialog finds an icon usable to display a dialog.

func LauncherAddNew

func LauncherAddNew(uri string, dock *CairoDock, order float64) Icon

LauncherAddNew adds a new launcher to the dock.

func NewIconFromNative

func NewIconFromNative(p unsafe.Pointer) Icon

NewIconFromNative wraps a gldi icon from C pointer.

func SeparatorIconAddNew

func SeparatorIconAddNew(dock *CairoDock, order float64) Icon

SeparatorIconAddNew adds a separator to the dock.

func StackIconAddNew

func StackIconAddNew(dock *CairoDock, order float64) Icon

StackIconAddNew adds a stack icon to the dock (subdock).

type Manager

type Manager struct {
	Ptr *C.GldiManager
}

Manager defines a dock manager.

func ManagerGet

func ManagerGet(name string) *Manager

ManagerGet gets the manager with the given name.

func NewManagerFromNative

func NewManagerFromNative(p unsafe.Pointer) *Manager

NewManagerFromNative wraps a dock manager from C pointer.

type Module

type Module struct {
	Ptr *C.GldiModule
}

Module defines a gldi module.

func ModuleGet

func ModuleGet(name string) *Module

ModuleGet gets the module for the given name.

func NewModuleFromNative

func NewModuleFromNative(p unsafe.Pointer) *Module

NewModuleFromNative wraps a gldi module from C pointer.

func (*Module) Activate

func (m *Module) Activate()

Activate activates the module.

func (*Module) AddInstance

func (m *Module) AddInstance()

AddInstance creates a new instance for the module.

func (*Module) ConfFileUpgrade

func (m *Module) ConfFileUpgrade() []string

ConfFileUpgrade upgrades the config file for active instances of the module. The file is renewed from default, and current values are reapplied.

func (*Module) Deactivate

func (m *Module) Deactivate()

Deactivate deactivates the module.

func (*Module) InstancesList

func (m *Module) InstancesList() (list []*ModuleInstance)

InstancesList returns the list of active instances for the module.

func (*Module) IsAutoLoaded

func (m *Module) IsAutoLoaded() bool

IsAutoLoaded returns whether the module was auto loaded or not.

func (*Module) ToNative

func (m *Module) ToNative() unsafe.Pointer

ToNative returns the pointer to the native object.

func (*Module) VisitCard

func (m *Module) VisitCard() *VisitCard

VisitCard returns the module visit card.

type ModuleInstance

type ModuleInstance struct {
	Ptr *C.GldiModuleInstance
	// contains filtered or unexported fields
}

ModuleInstance defines a gldi module instance.

func NewModuleInstanceFromNative

func NewModuleInstanceFromNative(p unsafe.Pointer) *ModuleInstance

NewModuleInstanceFromNative wraps a gldi module instance from C pointer.

func (*ModuleInstance) Desklet

func (mi *ModuleInstance) Desklet() *Desklet

Desklet returns the instance as a desklet if possible.

func (*ModuleInstance) Detach

func (mi *ModuleInstance) Detach()

Detach detaches the applet from the dock to a desklet.

func (*ModuleInstance) Dock

func (mi *ModuleInstance) Dock() *CairoDock

Dock returns the applet parent dock.

func (*ModuleInstance) GetConfFilePath

func (mi *ModuleInstance) GetConfFilePath() string

GetConfFilePath returns the path to the config file of the instance.

func (*ModuleInstance) Icon

func (mi *ModuleInstance) Icon() Icon

Icon returns the icon holding the instance.

func (*ModuleInstance) InsertIcons

func (mi *ModuleInstance) InsertIcons(clist *C.GList, dockRenderer, deskletRenderer string)

InsertIcons insert subdock icons in the applet.

func (*ModuleInstance) Module

func (mi *ModuleInstance) Module() *Module

Module returns the module for the instance.

func (*ModuleInstance) NewShortkey

func (mi *ModuleInstance) NewShortkey(group, key, desc, shortkey string, call func(string)) cdglobal.Shortkeyer

NewShortkey is a helper to create a shortkey related to a module instance.

func (*ModuleInstance) PopupAboutApplet

func (mi *ModuleInstance) PopupAboutApplet()

PopupAboutApplet opens the applet info dialog.

func (*ModuleInstance) PrepareNewIcons

func (mi *ModuleInstance) PrepareNewIcons(fields []string) (map[string]Icon, *C.GList)

PrepareNewIcons prepares icons to add in the subdock.

func (*ModuleInstance) RemoveAllIcons

func (mi *ModuleInstance) RemoveAllIcons()

RemoveAllIcons removes all subdock icons in the applet.

func (*ModuleInstance) ToNative

func (mi *ModuleInstance) ToNative() unsafe.Pointer

ToNative returns the pointer to the native object.

type RenderingMethod

type RenderingMethod int

RenderingMethod represents a screen display backend.

const (
	RenderingDefault RenderingMethod = C.GLDI_DEFAULT
	RenderingOpenGL  RenderingMethod = C.GLDI_OPENGL
	RenderingCairo   RenderingMethod = C.GLDI_CAIRO
)

Screen display backends.

type VisitCard

type VisitCard struct {
	Ptr *C.GldiVisitCard
}

VisitCard defines a dock visit card.

func NewVisitCardFromNative

func NewVisitCardFromNative(p unsafe.Pointer) *VisitCard

NewVisitCardFromNative wraps a dock visit card from C pointer.

func NewVisitCardFromPackage

func NewVisitCardFromPackage(pack *packages.AppletPackage) *VisitCard

NewVisitCardFromPackage wraps a dock visit card from an applet package.

func (*VisitCard) GetAuthor

func (vc *VisitCard) GetAuthor() string

GetAuthor returns the module author name.

func (*VisitCard) GetCategory

func (vc *VisitCard) GetCategory() cdtype.CategoryType

GetCategory returns the module category.

func (*VisitCard) GetConfFileName

func (vc *VisitCard) GetConfFileName() string

GetConfFileName returns the module container file name.

func (*VisitCard) GetContainerType

func (vc *VisitCard) GetContainerType() int

GetContainerType returns the module icon file path.

func (*VisitCard) GetDescription

func (vc *VisitCard) GetDescription() string

GetDescription returns the module description text translated.

func (*VisitCard) GetGettextDomain

func (vc *VisitCard) GetGettextDomain() string

GetGettextDomain returns the module gettext domain.

func (*VisitCard) GetIconFilePath

func (vc *VisitCard) GetIconFilePath() string

GetIconFilePath returns the module icon file path.

func (*VisitCard) GetModuleName

func (vc *VisitCard) GetModuleName() string

GetModuleName returns the module name (real one)

func (*VisitCard) GetModuleVersion

func (vc *VisitCard) GetModuleVersion() string

GetModuleVersion returns the module version.

func (*VisitCard) GetName

func (vc *VisitCard) GetName() string

GetName returns the module name used as identifier.

func (*VisitCard) GetPreviewFilePath

func (vc *VisitCard) GetPreviewFilePath() string

GetPreviewFilePath returns the module preview file path.

func (*VisitCard) GetShareDataDir

func (vc *VisitCard) GetShareDataDir() string

GetShareDataDir returns the module share data dir.

func (*VisitCard) GetTitle

func (vc *VisitCard) GetTitle() string

GetTitle returns the module name translated (as seen by the user).

func (*VisitCard) IsMultiInstance

func (vc *VisitCard) IsMultiInstance() bool

IsMultiInstance returns whether the module can be activated multiple times or not.

Directories

Path Synopsis
Package appgldi implements the dock applet API for go internal applets.
Package appgldi implements the dock applet API for go internal applets.
Package backendgui provides a GUI interface to interact with the dock GUI.
Package backendgui provides a GUI interface to interact with the dock GUI.
Package backendmenu provides menu events and widgets to build the menu.
Package backendmenu provides menu events and widgets to build the menu.
Package confdata provides a data source for the config, based on the gldi backend.
Package confdata provides a data source for the config, based on the gldi backend.
Package current provides access to the dock current theme variables.
Package current provides access to the dock current theme variables.
Package desktopclass defines a desktop class informations source.
Package desktopclass defines a desktop class informations source.
Package desktops manages and get desktop and screens info.
Package desktops manages and get desktop and screens info.
Package dialog provides access to gldi dialogs.
Package dialog provides access to gldi dialogs.
Package globals provides access to the dock global variables.
Package globals provides access to the dock global variables.
Package mgrgldi manages go applets as internal applets.
Package mgrgldi manages go applets as internal applets.
Package notif registers dock notifications.
Package notif registers dock notifications.
Package shortkeys manages keyboard shortkeys.
Package shortkeys manages keyboard shortkeys.
Package window manages desktop windows.
Package window manages desktop windows.

Jump to

Keyboard shortcuts

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