dock

package
v0.0.0-...-61f35a2 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2022 License: GPL-3.0 Imports: 51 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MotifHintFunctions = 1 << iota
	MotifHintDecorations
	MotifHintInputMode
	MotifHintStatus
)
View Source
const (
	MotifFunctionAll = 1 << iota
	MotifFunctionResize
	MotifFunctionMove
	MotifFunctionMinimize
	MotifFunctionMaximize
	MotifFunctionClose
	MotifFunctionNone = 0
)

Variables

This section is empty.

Functions

func NewNRGBAImageFromEwmhIcon

func NewNRGBAImageFromEwmhIcon(icon *ewmh.WMIcon) *image.NRGBA

Types

type AppEntries

type AppEntries struct {
	// contains filtered or unexported fields
}

func (*AppEntries) Append

func (entries *AppEntries) Append(entry *AppEntry)

func (*AppEntries) FilterDocked

func (entries *AppEntries) FilterDocked() (dockedEntries []*AppEntry)

func (*AppEntries) GetByDesktopFilePath

func (entries *AppEntries) GetByDesktopFilePath(desktopFilePath string) (*AppEntry, error)

func (*AppEntries) GetByInnerId

func (entries *AppEntries) GetByInnerId(id string) *AppEntry

func (*AppEntries) GetByWindowPid

func (entries *AppEntries) GetByWindowPid(pid uint) *AppEntry

func (*AppEntries) GetType

func (entries *AppEntries) GetType() reflect.Type

func (*AppEntries) GetValue

func (entries *AppEntries) GetValue() (val interface{}, err *dbus.Error)

func (*AppEntries) IndexOf

func (entries *AppEntries) IndexOf(entry *AppEntry) int

func (*AppEntries) Insert

func (entries *AppEntries) Insert(entry *AppEntry, index int)

func (*AppEntries) Move

func (entries *AppEntries) Move(index, newIndex int) error

func (*AppEntries) Remove

func (entries *AppEntries) Remove(entry *AppEntry)

func (*AppEntries) SetNotifyChangedFunc

func (entries *AppEntries) SetNotifyChangedFunc(func(val interface{}))

func (*AppEntries) SetValue

func (entries *AppEntries) SetValue(val interface{}) (changed bool, err *dbus.Error)

type AppEntry

type AppEntry struct {
	PropsMu  sync.RWMutex
	Id       string
	IsActive bool
	Name     string
	Icon     string
	// dbusutil-gen: ignore
	Menu          AppEntryMenu
	DesktopFile   string
	CurrentWindow x.Window
	IsDocked      bool
	// dbusutil-gen: equal=method:Equal
	WindowInfos windowInfosType
	// contains filtered or unexported fields
}

func (*AppEntry) Activate

func (entry *AppEntry) Activate(timestamp uint32) *dbus.Error

func (*AppEntry) Check

func (entry *AppEntry) Check() *dbus.Error

func (*AppEntry) ForceQuit

func (entry *AppEntry) ForceQuit() *dbus.Error

func (*AppEntry) GetAllowedCloseWindows

func (entry *AppEntry) GetAllowedCloseWindows() (windows []uint32, busErr *dbus.Error)

func (*AppEntry) GetExportedMethods

func (v *AppEntry) GetExportedMethods() dbusutil.ExportedMethods

func (*AppEntry) GetInterfaceName

func (e *AppEntry) GetInterfaceName() string

func (*AppEntry) HandleDragDrop

func (e *AppEntry) HandleDragDrop(timestamp uint32, files []string) *dbus.Error

func (*AppEntry) HandleMenuItem

func (e *AppEntry) HandleMenuItem(timestamp uint32, id string) *dbus.Error

func (*AppEntry) NewInstance

func (entry *AppEntry) NewInstance(timestamp uint32) *dbus.Error

func (*AppEntry) PresentWindows

func (entry *AppEntry) PresentWindows() *dbus.Error

func (*AppEntry) RequestDock

func (entry *AppEntry) RequestDock() *dbus.Error

RequestDock 驻留

func (*AppEntry) RequestUndock

func (entry *AppEntry) RequestUndock() *dbus.Error

RequestUndock 取消驻留

type AppEntryMenu

type AppEntryMenu struct {
	// contains filtered or unexported fields
}

func (*AppEntryMenu) GetType

func (*AppEntryMenu) GetType() reflect.Type

func (*AppEntryMenu) GetValue

func (m *AppEntryMenu) GetValue() (val interface{}, err *dbus.Error)

func (*AppEntryMenu) SetNotifyChangedFunc

func (*AppEntryMenu) SetNotifyChangedFunc(func(val interface{}))

func (*AppEntryMenu) SetValue

func (*AppEntryMenu) SetValue(val interface{}) (changed bool, err *dbus.Error)

type AppInfo

type AppInfo struct {
	// contains filtered or unexported fields
}

func NewAppInfo

func NewAppInfo(id string) *AppInfo

func NewAppInfoFromFile

func NewAppInfoFromFile(file string) *AppInfo

func NewDockedAppInfo

func NewDockedAppInfo(app string) *AppInfo

func (*AppInfo) GetActions

func (ai *AppInfo) GetActions() []desktopAction

func (*AppInfo) GetFileName

func (ai *AppInfo) GetFileName() string

func (*AppInfo) GetIcon

func (ai *AppInfo) GetIcon() string

func (*AppInfo) GetId

func (ai *AppInfo) GetId() string

func (*AppInfo) IsInstalled

func (ai *AppInfo) IsInstalled() bool

func (*AppInfo) String

func (ai *AppInfo) String() string

type Daemon

type Daemon struct {
	*loader.ModuleBase
}

func NewDaemon

func NewDaemon(logger *log.Logger) *Daemon

func (*Daemon) GetDependencies

func (d *Daemon) GetDependencies() []string

func (*Daemon) Name

func (d *Daemon) Name() string

func (*Daemon) Start

func (d *Daemon) Start() error

func (*Daemon) Stop

func (d *Daemon) Stop() error

type DisplayModeType

type DisplayModeType int32
const (
	DisplayModeFashionMode DisplayModeType = iota
	DisplayModeEfficientMode
	DisplayModeClassicMode
)

func (DisplayModeType) String

func (t DisplayModeType) String() string

type ExportWindowInfo

type ExportWindowInfo struct {
	Title string
	Flash bool
}

type HideModeType

type HideModeType int32
const (
	HideModeKeepShowing HideModeType = iota
	HideModeKeepHidden
	HideModeAutoHide // invalid
	HideModeSmartHide
)

func (HideModeType) String

func (t HideModeType) String() string

type HideStateType

type HideStateType int32
const (
	HideStateUnknown HideStateType = iota
	HideStateShow
	HideStateHide
)

func (HideStateType) String

func (s HideStateType) String() string

type IdentifyWindowFunc

type IdentifyWindowFunc struct {
	Name string
	Fn   _IdentifyWindowFunc
}

type KWindowInfo

type KWindowInfo struct {
	// contains filtered or unexported fields
}

type Manager

type Manager struct {
	PropsMu             sync.RWMutex
	Entries             AppEntries
	HideMode            gsprop.Enum `prop:"access:rw"`
	DisplayMode         gsprop.Enum `prop:"access:rw"`
	Position            gsprop.Enum `prop:"access:rw"`
	IconSize            gsprop.Uint `prop:"access:rw"`
	ShowTimeout         gsprop.Uint `prop:"access:rw"`
	HideTimeout         gsprop.Uint `prop:"access:rw"`
	WindowSizeEfficient gsprop.Uint `prop:"access:rw"`
	WindowSizeFashion   gsprop.Uint `prop:"access:rw"`
	DockedApps          gsprop.Strv
	Opacity             gsprop.Double
	HideState           HideStateType
	FrontendWindowRect  *Rect
	// contains filtered or unexported fields
}

func (*Manager) ActivateWindow

func (m *Manager) ActivateWindow(win uint32) *dbus.Error

ActivateWindow会激活给定id的窗口,被激活的窗口通常会成为焦点窗口。

func (*Manager) CancelPreviewWindow

func (m *Manager) CancelPreviewWindow() *dbus.Error

func (*Manager) CloseWindow

func (m *Manager) CloseWindow(win uint32) *dbus.Error

CloseWindow会将传入id的窗口关闭。

func (*Manager) DebugRegisterWW

func (m *Manager) DebugRegisterWW(id uint32) *dbus.Error

TODO: remove it

func (*Manager) DebugSetActiveWindow

func (m *Manager) DebugSetActiveWindow(id uint32) *dbus.Error

TODO: remove it

func (*Manager) GetDockedAppsDesktopFiles

func (m *Manager) GetDockedAppsDesktopFiles() (desktopFiles []string, busErr *dbus.Error)

func (*Manager) GetEntryIDs

func (m *Manager) GetEntryIDs() (list []string, busErr *dbus.Error)

for debug

func (*Manager) GetExportedMethods

func (v *Manager) GetExportedMethods() dbusutil.ExportedMethods

func (*Manager) GetInterfaceName

func (m *Manager) GetInterfaceName() string

func (*Manager) GetPluginSettings

func (m *Manager) GetPluginSettings() (jsonStr string, busErr *dbus.Error)

func (*Manager) IsDocked

func (m *Manager) IsDocked(desktopFile string) (docked bool, busErr *dbus.Error)

func (*Manager) IsOnDock

func (m *Manager) IsOnDock(desktopFile string) (onDock bool, busErr *dbus.Error)

func (*Manager) MakeWindowAbove

func (m *Manager) MakeWindowAbove(win uint32) *dbus.Error

func (*Manager) MaximizeWindow

func (m *Manager) MaximizeWindow(win uint32) *dbus.Error

func (*Manager) MergePluginSettings

func (m *Manager) MergePluginSettings(jsonStr string) *dbus.Error

func (*Manager) MinimizeWindow

func (m *Manager) MinimizeWindow(win uint32) *dbus.Error

func (*Manager) MoveEntry

func (m *Manager) MoveEntry(index, newIndex int32) *dbus.Error

func (*Manager) MoveWindow

func (m *Manager) MoveWindow(win uint32) *dbus.Error

func (*Manager) PreviewWindow

func (m *Manager) PreviewWindow(win uint32) *dbus.Error

func (*Manager) QueryWindowIdentifyMethod

func (m *Manager) QueryWindowIdentifyMethod(wid uint32) (method string, busErr *dbus.Error)

func (*Manager) RemovePluginSettings

func (m *Manager) RemovePluginSettings(key1 string, key2List []string) *dbus.Error

func (*Manager) RequestDock

func (m *Manager) RequestDock(desktopFile string, index int32) (docked bool, busErr *dbus.Error)

func (*Manager) RequestUndock

func (m *Manager) RequestUndock(desktopFile string) (undocked bool, busErr *dbus.Error)

func (*Manager) SetFrontendWindowRect

func (m *Manager) SetFrontendWindowRect(x, y int32, width, height uint32) *dbus.Error

func (*Manager) SetPluginSettings

func (m *Manager) SetPluginSettings(jsonStr string) *dbus.Error
type Menu struct {
	Items         []*MenuItem `json:"items"`
	CheckableMenu bool        `json:"checkableMenu"`
	SingleCheck   bool        `json:"singleCheck"`
	// contains filtered or unexported fields
}

func NewMenu

func NewMenu() *Menu
func (m *Menu) AppendItem(items ...*MenuItem)
func (m *Menu) GenerateJSON() string
func (m *Menu) HandleAction(id string, timestamp uint32) error
type MenuItem struct {
	Id            string `json:"itemId"`
	Text          string `json:"itemText"`
	IsActive      bool   `json:"isActive"`
	IsCheckable   bool   `json:"isCheckable"`
	Checked       bool   `json:"checked"`
	Icon          string `json:"itemIcon"`
	IconHover     string `json:"itemIconHover"`
	IconInactive  string `json:"itemIconInactive"`
	ShowCheckMark bool   `json:"showCheckMark"`
	SubMenu       *Menu  `json:"itemSubMenu"`
	// contains filtered or unexported fields
}

func NewMenuItem

func NewMenuItem(name string, action func(uint32), enable bool) *MenuItem

type MotifWmHints

type MotifWmHints struct {
	Flags       uint32
	Functions   uint32
	Decorations uint32
	InputMode   int32
	Status      uint32
}

type ProcessInfo

type ProcessInfo struct {
	// contains filtered or unexported fields
}

func NewProcessInfo

func NewProcessInfo(pid uint) (*ProcessInfo, error)

func NewProcessInfoWithCmdline

func NewProcessInfoWithCmdline(cmd []string) *ProcessInfo

func (*ProcessInfo) GetOneCommandLine

func (p *ProcessInfo) GetOneCommandLine() string

func (*ProcessInfo) GetShellScriptLines

func (p *ProcessInfo) GetShellScriptLines() string

type Rect

type Rect struct {
	X, Y          int32
	Width, Height uint32
}

func NewRect

func NewRect() *Rect

func (*Rect) Pieces

func (r *Rect) Pieces() (int, int, int, int)

type RuleMatchFunc

type RuleMatchFunc func(string) bool

type RuleValueParsed

type RuleValueParsed struct {
	Fn       RuleMatchFunc
	Type     byte
	Flags    RuleValueParsedFlag
	Original string
	Value    string
}

func (*RuleValueParsed) String

func (p *RuleValueParsed) String() string

type RuleValueParsedFlag

type RuleValueParsedFlag uint
const (
	RuleValueParsedFlagNone RuleValueParsedFlag = 1 << iota
	RuleValueParsedFlagNegative
	RuleValueParsedFlagIgnoreCase
)

type WaylandManager

type WaylandManager struct {
	// contains filtered or unexported fields
}

type WindowInfo

type WindowInfo struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewWindowInfo

func NewWindowInfo(win x.Window) *WindowInfo

type WindowInfoImp

type WindowInfoImp interface {
	// contains filtered or unexported methods
}

type WindowPattern

type WindowPattern struct {
	Rules       []WindowRule `json:"rules"`
	Result      string       `json:"ret"`
	ParsedRules []*WindowRuleParsed
}

type WindowPatterns

type WindowPatterns []WindowPattern

func (WindowPatterns) Match

func (patterns WindowPatterns) Match(winInfo *WindowInfo) string

type WindowRule

type WindowRule [2]string

func (*WindowRule) Parse

func (rule *WindowRule) Parse() *WindowRuleParsed

type WindowRuleParsed

type WindowRuleParsed struct {
	Key         string
	ValueParsed *RuleValueParsed
}

func (*WindowRuleParsed) Match

func (rule *WindowRuleParsed) Match(winInfo *WindowInfo) bool

Jump to

Keyboard shortcuts

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