godock: github.com/sqp/godock/libs/cdglobal Index | Files

package cdglobal

import "github.com/sqp/godock/libs/cdglobal"

Package cdglobal defines application and backend global consts and data.


Package Files

cdglobal.go interfaces.go


const (
    DockThemeServerTag     = "themes3.4" // CAIRO_DOCK_DISTANT_THEMES_DIR
    DownloadServerListFile = "list.conf" // Name of the applets list file on the server.

Download server locations.

const (
    AppletsDirName   = "third-party"
    AppletsServerTag = "3.4.0"

External applets constants.

const (
    ConfigDirBaseName     = "cairo-dock"    // Default config path in .config  (CAIRO_DOCK_DATA_DIR).
    ConfigDirCurrentTheme = "current_theme" // Name of dir for current theme   (CAIRO_DOCK_CURRENT_THEME_NAME).
    ConfigDirDockThemes   = "themes"        // Name of dir for saved themes    (CAIRO_DOCK_THEMES_DIR).
    ConfigDirExtras       = "extras"        // Name of dir for extra themes    (CAIRO_DOCK_EXTRAS_DIR).
    ConfigDirPlugIns      = "plug-ins"      // Name of dir for plugins         (CAIRO_DOCK_PLUG_INS_DIR).
    ConfigDirDockImages   = "images"        // Name of dir for dock images    (CAIRO_DOCK_LOCAL_IMAGES_DIR).

    // Only in DirShareData (/usr/share/cairo-dock).
    ConfigDirAppletsGo = "appletsgo" // Name of dir for go applets
    ConfigDirDefaults  = "defaults"  // Name of dir for dock default config files. TODO: need to move all old files here.

Config dir names.

const (
    GettextPackageCairoDock = "cairo-dock"         // CAIRO_DOCK_GETTEXT_PACKAGE
    GettextPackagePlugins   = "cairo-dock-plugins" // GETTEXT_NAME_EXTRAS

Translation domain.

const (
    FileHiddenConfig  = ".cairo-dock"
    FileBuildSource   = "build.conf" // with globals.DirUserAppData
    FileChangelog     = "ChangeLog.txt"
    FileConfigThemes  = "themes.conf"    // in DirShareData
    FileCairoDockIcon = "cairo-dock.svg" // CAIRO_DOCK_ICON
     = "cairo-dock-logo.png"

Config files.

const CmdOpen = "xdg-open"

CmdOpen defines the default open file/dir/url system command. May not be portable (lol), but it's still grouped here.

const (
    DirUserAppData = "appdata" // store user common applets data in ~/.cairo-dock/

User config dir names.

const FileMode os.FileMode = 0644

FileMode defines the default rights when writing a new file.


var (
    BuildMode     = "manual" // "manual" for custom builds. Let's also use "makefile", "package", "dockrepo"
    BuildDate     = ""       // Full readable date of build.
    BuildNbEdited = ""       // Number of files edited. Format: "not cached + already cached + untracked"
    GitHash       = ""       // Git commit hash.

Version variables also set at build time.

var (
    // CairoDockShareThemesDir defines system dock themes dir (CAIRO_DOCK_SHARE_THEMES_DIR).
    CairoDockShareThemesDir = "/usr/share/cairo-dock/themes"

    // CairoDockLocaleDir defines system dock locale dir (CAIRO_DOCK_LOCALE_DIR).
    CairoDockLocaleDir = "/usr/share/locale"

    // DownloadServerURL defines the URL of the distant theme server.
    DownloadServerURL = "http://download.tuxfamily.org/glxdock/themes" // CAIRO_DOCK_THEME_SERVER

Original Cairo-Dock system dir locations. Can be overridden at build time. May be useful for distro packagers.

var AppBuildPath = []string{"github.com", "sqp", "godock"}

AppBuildPath defines the application build location inside GOPATH.

var AppName = "NewDock" // TODO: set real value.

AppName defines the readable application name.

var AppVersion = ""

AppVersion defines the application version.

The -git suffix is used to tag the default value, but it should be removed if the Makefile was used for the build, and the real version was set.

func AppBuildPathFull Uses

func AppBuildPathFull(path ...string) string

AppBuildPathFull returns the full path to the application build directory.

func ConfigDirDock Uses

func ConfigDirDock(dir string) string

ConfigDirDock returns a full path to the dock config dir, according to the given user option.

func DirAppletsExternal Uses

func DirAppletsExternal(configDir string) (string, error)

DirAppletsExternal returns external applets location.

type Crypto Uses

type Crypto interface {
    DecryptString(str string) string
    EncryptString(str string) string

Crypto defines a way to decrypt and encrypt strings.

type DeskEnvironment Uses

type DeskEnvironment int

DeskEnvironment represents a desktop environment.

const (
    DeskEnvGnome DeskEnvironment = iota

Desktop environment backends.

func DesktEnvFromString Uses

func DesktEnvFromString(envstr string) DeskEnvironment

DesktEnvFromString finds the desktop environment backend from the string.

type DisplayMode Uses

type DisplayMode int

DisplayMode defines the dock display backend.

const (
    DisplayModeAll DisplayMode = iota

Key display based on the display mode.

type Shortkeyer Uses

type Shortkeyer interface {
    // ConfFilePath returns the shortkey conf file path.
    ConfFilePath() string

    // Demander returns the shortkey Demander.
    Demander() string

    // Description returns the shortkey description.
    Description() string

    // GroupName returns the shortkey group name.
    GroupName() string

    // IconFilePath returns the shortkey icon file path.
    IconFilePath() string

    // KeyName returns the config key name.
    KeyName() string

    // KeyString returns the shortkey key reference as string.
    KeyString() string

    // Rebind rebinds the shortkey.
    Rebind(keystring, description string) bool

    // Success returns the shortkey success.
    Success() bool

Shortkeyer defines the interface to keyboard shortkeys.

type Window Uses

type Window interface {

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

    // CanMinMaxClose returns whether the window can do those actions.
    CanMinMaxClose() (bool, bool, bool)

    // Class returns the window class name.
    Class() string

    // IsAbove returns whether the window is above.
    IsAbove() bool // could split OrBelow but seem unused

    // IsActive returns whether the window is active.
    IsActive() bool

    // IsFullScreen returns whether the window is full screen.
    IsFullScreen() bool

    // IsHidden returns whether the window is hidden.
    IsHidden() bool

    // IsMaximized returns whether the window is maximized.
    IsMaximized() bool

    // IsOnCurrentDesktop returns whether the window is on current desktop.
    IsOnCurrentDesktop() bool

    // IsOnDesktop returns whether the window is the given desktop and viewport number.
    IsOnDesktop(desktopNumber, viewPortX, viewPortY int) bool

    // IsSticky returns whether the window is sticky.
    IsSticky() bool

    // IsTransientWin returns whether the window is a transient (modal) for another.
    IsTransientWin() bool

    // NumDesktop returns window desktop number. Can be -1.
    NumDesktop() int

    // StackOrder returns window stack order.
    StackOrder() int

    // ViewPortX returns window horizontal viewport number.
    ViewPortX() int

    // ViewPortY returns window vertical viewport number.
    ViewPortY() int

    // XID returns the window X identifier.
    XID() uint

    // Close closes window.

    // GetTransientWin returns the parent window for a transient (modal).
    GetTransientWin() Window

    // Kill kills the window.

    // Lower lowers the window.

    // Maximize maximizes the window.
    Maximize(full bool)

    // Minimize minimizes the window.

    // MoveToCurrentDesktop moves the window to the current desktop.

    // MoveToDesktop move the window to the given desktop and viewport number.
    MoveToDesktop(desktopNumber, viewPortX, viewPortY int)

    // SetAbove sets the window above.
    SetAbove(above bool)

    // SetFullScreen sets the window full screen state.
    SetFullScreen(full bool)

    // SetSticky sets the window sticky state.
    SetSticky(sticky bool)

    // Show shows the window.

    // SetVisibility sets the window visibility.
    SetVisibility(show bool)

    // ToggleVisibility toggles the window visibility.

Window defines the interface to desktop windows.

Package cdglobal imports 6 packages (graph) and is imported by 37 packages. Updated 2017-10-04. Refresh now. Tools for package owners.