godock: github.com/sqp/godock/widgets/cfbuild/datatype Index | Files

package datatype

import "github.com/sqp/godock/widgets/cfbuild/datatype"

Package datatype defines the data source format for the config.

Index

Package Files

datatype.go

Constants

const (
    // KeyMainDock is the key name of the first main dock (the one with the taskbar).
    //
    KeyMainDock = "_MainDock_"

    // KeyNewDock is the key name for a new dock to create.
    //
    KeyNewDock = "_New Dock_"
)
const (
    // GroupServices is the key name for the services group.
    //
    GroupServices = "_services_"

    // TitleServices is the displayed name for the services group (translatable).
    //
    TitleServices = "Services"

    // GroupDesklets is the key name for the desklets group.
    //
    GroupDesklets = "Desklets"

    // TitleDesklets is the displayed name for the desklets group (translatable).
    //
    TitleDesklets = "Desklets"

    // FieldTaskBar is the key name for the taskbar field.
    //
    FieldTaskBar = "TaskBar"

    // TitleTaskBar is the displayed name for the taskbar field (translatable).
    //
    TitleTaskBar = "--[ Taskbar ]--"
)

Custom config groups for the Icons GUI.

const (
    // DirIconsSystem is the location of desktop icons themes installed on the system.
    //
    DirIconsSystem = "/usr/share/icons"

    // DirIconsUser is the name of desktop icons themes dir in the user home dir.
    //
    DirIconsUser = ".icons" // in $HOME
)

Icons locations.

func IndexHandbooksKeys Uses

func IndexHandbooksKeys(books map[string]Handbooker) (list []string)

IndexHandbooksKeys returns the list of row keys in an index of handbooks.

func IndexHandbooksToFields Uses

func IndexHandbooksToFields(in map[string]Handbooker) (fields []Field)

IndexHandbooksToFields converts an index of handbooks to a list of fields.

func ListFieldsIDByName Uses

func ListFieldsIDByName(fields []Field, key string, log cdtype.Logger) int

ListFieldsIDByName searches the list of fields for the matching key. Returns the position of the field in the list. Returns 0 if not found, to have a valid entry to select.

func ListFieldsKeys Uses

func ListFieldsKeys(fields []Field) []string

ListFieldsKeys returns the list of row keys in a list of fields.

func ListFieldsSortByName Uses

func ListFieldsSortByName(fields []Field)

ListFieldsSortByName sorts the list of fields by their readable name.

func ListHandbooksKeys Uses

func ListHandbooksKeys(books []Handbooker) []string

ListHandbooksKeys returns the list of row keys in a list of handbooks.

type Appleter Uses

type Appleter interface {

    // Icon() string
    IsInstalled() bool
    Install(options string) error
    Uninstall() error
    CanUninstall() bool
    IsActive() bool
    Activate() string
    Deactivate()
    CanAdd() bool

    GetTitle() string // module name translated for the user.
    GetName() string  // module name used as key.
    GetAuthor() string
    GetDescription() string
    GetPreviewFilePath() string
    GetIconFilePath() string
    IconState() string
    FormatState() string
    FormatSize() string
    FormatCategory() string
    Dir() string
}

Appleter defines the interface needed by applets provided as config source.

type DesktopClassNil Uses

type DesktopClassNil struct{}

DesktopClassNil provides an empty DesktopClasser.

func (DesktopClassNil) Command Uses

func (DesktopClassNil) Command() string

Command is unused.

func (DesktopClassNil) Icon Uses

func (DesktopClassNil) Icon() string

Icon is unused.

func (DesktopClassNil) MenuItems Uses

func (DesktopClassNil) MenuItems() [][]string

MenuItems is unused.

func (DesktopClassNil) Name Uses

func (DesktopClassNil) Name() string

Name is unused.

func (DesktopClassNil) String Uses

func (DesktopClassNil) String() string

String is unused.

type DesktopClasser Uses

type DesktopClasser interface {
    // String returns the desktop class as a string.
    //
    String() string

    // Name returns the desktop class application name.
    //
    Name() string

    // Command returns the desktop class command.
    //
    Command() string

    // Icon returns the desktop class icon.
    //
    Icon() string

    // MenuItems returns the list of extra commands for the class, by packs of 3
    // strings: Name, Command, Icon.
    //
    MenuItems() [][]string
}

DesktopClasser defines methods to get informations about a desktop class.

type Field Uses

type Field struct {
    Conf string
    Key  string
    Name string
    Icon string
}

Field defines a simple data field for dock queries.

type HandbookDescDisk Uses

type HandbookDescDisk struct{ Handbooker }

HandbookDescDisk improves Handbooker to read the description from disk, using the current description value as source path.

func (*HandbookDescDisk) GetDescription Uses

func (dv *HandbookDescDisk) GetDescription() string

GetDescription returns the book icon name or path.

type HandbookDescSplit Uses

type HandbookDescSplit struct{ Handbooker }

HandbookDescSplit improves Handbooker by replacing \n to EOL in description.

func (*HandbookDescSplit) GetDescription Uses

func (dv *HandbookDescSplit) GetDescription() string

GetDescription returns the book description.

type HandbookSimple Uses

type HandbookSimple struct {
    Key         string
    Title       string
    Author      string
    Description string
    Preview     string
}

HandbookSimple provides a simple Handbooker.

func (*HandbookSimple) GetAuthor Uses

func (hs *HandbookSimple) GetAuthor() string

GetAuthor returns the book author.

func (*HandbookSimple) GetDescription Uses

func (hs *HandbookSimple) GetDescription() string

GetDescription returns the book description.

func (*HandbookSimple) GetGettextDomain Uses

func (hs *HandbookSimple) GetGettextDomain() string

GetGettextDomain is unused.

func (*HandbookSimple) GetModuleVersion Uses

func (hs *HandbookSimple) GetModuleVersion() string

GetModuleVersion is unused.

func (*HandbookSimple) GetName Uses

func (hs *HandbookSimple) GetName() string

GetName returns the book key.

func (*HandbookSimple) GetPreviewFilePath Uses

func (hs *HandbookSimple) GetPreviewFilePath() string

GetPreviewFilePath returns the book preview path.

func (*HandbookSimple) GetTitle Uses

func (hs *HandbookSimple) GetTitle() string

GetTitle returns the book readable name.

type Handbooker Uses

type Handbooker interface {
    // GetName returns the book key.
    //
    GetName() string // name will be used as key.

    // GetTitle returns the book readable name.
    //
    GetTitle() string

    // GetAuthor returns the book author.
    //
    GetAuthor() string

    // GetDescription returns the book description.
    //
    GetDescription() string

    // GetDescription returns the book icon name or path.
    //
    GetPreviewFilePath() string

    // GetDescription returns the book gettext domain for translations.
    //
    GetGettextDomain() string

    // GetDescription returns the book version.
    //
    GetModuleVersion() string
}

Handbooker defines the interface needed by handbook module data provided as config source.

type IconSimple Uses

type IconSimple struct {
    Field
    Taskbar bool
}

IconSimple provides a simple Iconer.

func NewIconSimple Uses

func NewIconSimple(conf, key, name, icon string) *IconSimple

NewIconSimple creates a simple Iconer compatible object.

func (*IconSimple) ConfigGroup Uses

func (is *IconSimple) ConfigGroup() string

ConfigGroup gives the config group to build if any, or the special config key if no config file is defined.

func (*IconSimple) ConfigPath Uses

func (is *IconSimple) ConfigPath() string

ConfigPath returns the key.

func (*IconSimple) DefaultNameIcon Uses

func (is *IconSimple) DefaultNameIcon() (string, string)

DefaultNameIcon returns improved name and image for the icon if possible.

func (*IconSimple) GetClass Uses

func (is *IconSimple) GetClass() DesktopClasser

GetClass is unused ATM.

func (*IconSimple) GetCommand Uses

func (is *IconSimple) GetCommand() string

GetCommand is unused ATM.

func (*IconSimple) GetGettextDomain Uses

func (is *IconSimple) GetGettextDomain() string

GetGettextDomain is unused.

func (*IconSimple) IsLauncher Uses

func (is *IconSimple) IsLauncher() bool

IsLauncher returns whether the icon is a separator or not.

func (*IconSimple) IsStackIcon Uses

func (is *IconSimple) IsStackIcon() bool

IsStackIcon returns whether the icon is a stack icon (subdock) or not.

func (*IconSimple) IsTaskbar Uses

func (is *IconSimple) IsTaskbar() bool

IsTaskbar returns whether the icon belongs to the taskbar or not.

func (*IconSimple) MoveAfterNext Uses

func (is *IconSimple) MoveAfterNext()

MoveAfterNext is unused.

func (*IconSimple) MoveBeforePrevious Uses

func (is *IconSimple) MoveBeforePrevious()

MoveBeforePrevious is unused.

func (*IconSimple) OriginalConfigPath Uses

func (is *IconSimple) OriginalConfigPath() string

OriginalConfigPath is unused.

func (*IconSimple) Reload Uses

func (is *IconSimple) Reload()

Reload is unused ATM.

func (*IconSimple) RemoveFromDock Uses

func (is *IconSimple) RemoveFromDock()

RemoveFromDock is unused.

type Iconer Uses

type Iconer interface {
    // ConfigPath gives the full path to the icon config file.
    //
    ConfigPath() string

    // OriginalConfigPath gives the full path to the icon original config file.
    // This is the default unchanged config file.
    //
    OriginalConfigPath() string

    DefaultNameIcon() (string, string) //applets map[string]*packages.AppletPackage) (string, string)
    IsTaskbar() bool
    IsLauncher() bool

    IsStackIcon() bool

    // ConfigGroup gives the config group to build if any.
    // If no config file is set, it defines a special config key.
    //
    ConfigGroup() string

    // GetClass returns the class defined for the icon, able to get all related
    // desktop class informations.
    //
    GetClass() DesktopClasser

    GetCommand() string
    Reload()

    // MoveAfterNext swaps the icon position with the previous one.
    //
    MoveBeforePrevious()

    // MoveAfterNext swaps the icon position with the next one.
    //
    MoveAfterNext()

    // RemoveFromDock removes the icon from the dock.
    RemoveFromDock()

    // GetGettextDomain returns the translation domain for the applet.
    GetGettextDomain() string
}

Iconer defines the interface needed by icons provided as config source.

type ListIcon Uses

type ListIcon struct {
    Maindocks []*ListIconContainer
    Subdocks  map[string][]Iconer
}

ListIcon defines data for icons list building.

Maindocks  list of container + icons. (maindocks, desklets, services)
Subdocks   index of SubdockName => list of icons.

func NewListIcon Uses

func NewListIcon() *ListIcon

NewListIcon creates a container to list dock icons.

func (*ListIcon) Add Uses

func (li *ListIcon) Add(container Iconer, icons []Iconer)

Add adds a container with its icons in the list.

type ListIconContainer Uses

type ListIconContainer struct {
    Container Iconer
    Icons     []Iconer
}

ListIconContainer defines a ListIcon container with its icons.

type Source Uses

type Source interface {
    cdglobal.Crypto // Encrypt and Decrypt string.

    //MainConfigFile returns the full path to the dock config file.
    //
    MainConfigFile() string

    //MainConfigDefault returns the full path to the dock config file.
    //
    MainConfigDefault() string

    // AppIcon returns the application icon path.
    //
    AppIcon() string

    // DirUserAppData returns the path to user applet common data in ~/.config/cairo-dock/
    //
    DirUserAppData(path ...string) (string, error)

    // DirShareData returns the path to the shared data dir (/usr/share/cairo-dock/).
    //
    DirShareData(path ...string) string

    // DesktopClasser allows to get desktop class informations for a given name.
    //
    DesktopClasser(class string) DesktopClasser

    // DisplayMode tells which renderer mode is used.
    //
    DisplayMode() cdglobal.DisplayMode

    // ListIcons builds the list of all icons.
    //
    ListIcons() *ListIcon

    // ListKnownApplets builds the list of all applets.
    //
    ListKnownApplets() map[string]Appleter

    // ListDownloadApplets builds the list of downloadable user applets (installed or not).
    //
    ListDownloadApplets() (map[string]Appleter, error)

    // ListIconsMainDock builds the list of icons in the maindock.
    //
    ListIconsMainDock() []Field

    // ListShortkeys returns the list of dock shortkeys.
    //
    ListShortkeys() []cdglobal.Shortkeyer

    // ListScreens returns the list of screens (active monitors on the session).
    //
    ListScreens() []Field

    // ListViews returns the list of views.
    //
    ListViews() map[string]Handbooker

    // ListAnimations returns the list of animations.
    //
    ListAnimations() []Field

    // ListDeskletDecorations returns the list of desklet decorations.
    //
    ListDeskletDecorations() []Field

    // ListDialogDecorator returns the list of dialog decorators.
    //
    ListDialogDecorator() []Field

    // ListDocks builds the list of docks with a readable name.
    // Both options are docks to remove from the list. Subdock childrens are removed too.
    //
    ListDocks(parent, subdock string) []Field

    // ListThemeDesktopIcon builds a list of desktop icon-themes in system and user dir.
    //
    ListThemeDesktopIcon() []Field

    // ListDockThemes builds the list of dock themes local and distant.
    //
    ListDockThemeLoad() (map[string]Appleter, error)

    // ListDockThemes builds the list of dock themes local only.
    //
    ListDockThemeSave() []Field

    // CurrentThemeSave saves the current dock theme.
    //
    CurrentThemeSave(themeName string, saveBehaviour, saveLaunchers, needPackage bool, dirPackage string) error

    // CurrentThemeLoad imports and loads a dock theme.
    //
    CurrentThemeLoad(themeName string, useBehaviour, useLaunchers bool) error

    // Handbook creates a handbook (description) for the given applet name.
    //
    Handbook(appletName string) Handbooker

    // ListThemeXML builds a list of icon theme in system and user dir.
    //
    ListThemeXML(localSystem, localUser, distant string) map[string]Handbooker

    // ListThemeINI builds a list of icon theme in system and user dir.
    //
    ListThemeINI(localSystem, localUser, distant string) map[string]Handbooker

    // ManagerReload reloads the manager matching the given name.
    //
    ManagerReload(name string, b bool, keyf *keyfile.KeyFile)

    // CreateMainDock creates a new main dock to store a moved icon.
    //
    CreateMainDock() string

    // GrabWindowClass waits a user window selection and returns its class.
    //
    GrabWindowClass() (string, error)
}

Source defines external data needed by the config builder.

type SourceCommon Uses

type SourceCommon struct {
    Log     cdtype.Logger
    ConfDir string // Path to user config dir with "extras" themes dir.
}

SourceCommon provides common methods for dock config data source.

func (SourceCommon) ListThemeDesktopIcon Uses

func (SourceCommon) ListThemeDesktopIcon() []Field

ListThemeDesktopIcon builds a list of desktop icon-themes in system and user dir.

func (SourceCommon) ListThemeINI Uses

func (sc SourceCommon) ListThemeINI(localSystem, localUser, distant string) map[string]Handbooker

ListThemeINI builds a list of icon theme in system and user dir.

func (SourceCommon) ListThemeXML Uses

func (sc SourceCommon) ListThemeXML(localSystem, localUser, distant string) map[string]Handbooker

ListThemeXML builds a list of icon theme in system and user dir.

type UpdateModuleStater Uses

type UpdateModuleStater interface {
    UpdateModuleState(name string, active bool)
}

UpdateModuleStater defines the UpdateModuleState single interface.

Package datatype imports 10 packages (graph) and is imported by 13 packages. Updated 2017-09-28. Refresh now. Tools for package owners.