Documentation ¶
Overview ¶
Package cdglobal defines application and backend global consts and data.
Index ¶
Constants ¶
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 FileCairoDockLogo = "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.
Variables ¶
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 ( // 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 )CairoDockShareThemesDir = "/usr/share/cairo-dock/themes"
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 = "0.0.3.5-git"
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.
Functions ¶
func AppBuildPathFull ¶
AppBuildPathFull returns the full path to the application build directory.
func ConfigDirDock ¶
ConfigDirDock returns a full path to the dock config dir, according to the given user option.
func DirAppletsExternal ¶
DirAppletsExternal returns external applets location.
Types ¶
type DeskEnvironment ¶
type DeskEnvironment int
DeskEnvironment represents a desktop environment.
const ( DeskEnvGnome DeskEnvironment = iota DeskEnvKDE DeskEnvXFCE DeskEnvUnknown )
Desktop environment backends.
func DesktEnvFromString ¶
func DesktEnvFromString(envstr string) DeskEnvironment
DesktEnvFromString finds the desktop environment backend from the string.
type DisplayMode ¶
type DisplayMode int
DisplayMode defines the dock display backend.
const ( DisplayModeAll DisplayMode = iota DisplayModeCairo DisplayModeOpenGL )
Key display based on the display mode.
type Shortkeyer ¶
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 ¶
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. // Close() // GetTransientWin returns the parent window for a transient (modal). // GetTransientWin() Window // Kill kills the window. // Kill() // Lower lowers the window. // Lower() // Maximize maximizes the window. // Maximize(full bool) // Minimize minimizes the window. // Minimize() // MoveToCurrentDesktop moves the window to the current desktop. // MoveToCurrentDesktop() // 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. // Show() // SetVisibility sets the window visibility. // SetVisibility(show bool) // ToggleVisibility toggles the window visibility. // ToggleVisibility() }
Window defines the interface to desktop windows.