Documentation
¶
Index ¶
- Constants
- func RegisterModule(m ModuleMetadata)
- func SetInstance(desk Desktop)
- type AppData
- type ApplicationProvider
- type DeskSettings
- type Desktop
- type KeyBindModule
- type LaunchSuggestion
- type LaunchSuggestionModule
- type Module
- type ModuleMetadata
- type Screen
- type ScreenAreaModule
- type ScreenList
- type Shortcut
- type Stack
- type StackListener
- type StatusAreaModule
- type Window
- type WindowManager
- type WindowProperties
Constants ¶
const ( // AnyModifier is the shortcut modifier to use if the shortcut should always trigger - use sparingly AnyModifier deskDriver.Modifier = 0 // UserModifier is the shortcut modifier to use if the shortcut should respect user preference. // This will be offered as a choice of Alt or Super (Command) UserModifier deskDriver.Modifier = deskDriver.SuperModifier << 1 // KeyBrightnessDown is the virtual keyboard key for reducing brightness KeyBrightnessDown fyne.KeyName = "BrightnessDown" // KeyBrightnessUp is the virtual keyboard key for increasing brightness KeyBrightnessUp fyne.KeyName = "BrightnessUp" // KeyCalculator is available on some multimedia keyboards to open a calculator KeyCalculator fyne.KeyName = "Calculator" // KeyVolumeMute is the virtual keyboard key for muting sound KeyVolumeMute fyne.KeyName = "VolumeMute" // KeyVolumeDown is the virtual keyboard key for reducing sound level KeyVolumeDown fyne.KeyName = "VolumeDown" // KeyVolumeUp is the virtual keyboard key for increasing sound level KeyVolumeUp fyne.KeyName = "VolumeUp" )
Variables ¶
This section is empty.
Functions ¶
func RegisterModule ¶ added in v0.2.0
func RegisterModule(m ModuleMetadata)
RegisterModule adds a module to the list of available modules. New module packages should probably call this in their init().
Types ¶
type AppData ¶
type AppData interface { Name() string // Name is the name of the app usually Run([]string) error // Run is the command to run the app, passing any environment variables to be set Categories() []string // Categories is a list of categories that the app fits in (platform specific) Hidden() bool // Hidden specifies whether instances of this app should be hidden Icon(theme string, size int) fyne.Resource // Icon returns an icon for the app in the requested theme and size }
AppData is an interface for accessing information about application icons
type ApplicationProvider ¶
type ApplicationProvider interface { AvailableApps() []AppData AvailableThemes() []string FindAppFromName(appName string) AppData FindAppFromWinInfo(win Window) AppData FindAppsMatching(pattern string) []AppData DefaultApps() []AppData CategorizedApps() map[string][]AppData }
ApplicationProvider describes a type that can locate icons and applications for the current system
type DeskSettings ¶
type DeskSettings interface { Background() string IconTheme() string BorderButtonPosition() string ClockFormatting() string LauncherIcons() []string LauncherIconSize() float32 LauncherDisableTaskbar() bool LauncherDisableZoom() bool LauncherZoomScale() float32 KeyboardModifier() deskDriver.Modifier ModuleNames() []string AddChangeListener(listener chan DeskSettings) }
DeskSettings describes the configuration options available for Fyne desktop
type Desktop ¶
type Desktop interface { Run() RunApp(AppData) error RecentApps() []AppData Settings() DeskSettings ContentSizePixels(screen *Screen) (uint32, uint32) Screens() ScreenList IconProvider() ApplicationProvider WindowManager() WindowManager Modules() []Module AddShortcut(shortcut *Shortcut, handler func()) ShowMenuAt(menu *fyne.Menu, pos fyne.Position) }
Desktop defines an embedded or full desktop environment that we can run.
type KeyBindModule ¶ added in v0.2.0
type KeyBindModule interface {
Shortcuts() map[*Shortcut]func()
}
KeyBindModule marks a module that provides key bindings. This is optional but can be enabled for any module by implementing the interface.
type LaunchSuggestion ¶ added in v0.2.0
type LaunchSuggestion interface { Icon() fyne.Resource Title() string Launch() }
LaunchSuggestion represents an item that can appear in the app launcher and be actioned on tap
type LaunchSuggestionModule ¶ added in v0.2.0
type LaunchSuggestionModule interface { Module LaunchSuggestions(string) []LaunchSuggestion }
LaunchSuggestionModule is a module that can provide suggestions for the app launcher
type Module ¶ added in v0.2.0
type Module interface { Metadata() ModuleMetadata Destroy() }
Module marks the required methods of a pluggable module in FyneDesk.
type ModuleMetadata ¶ added in v0.2.0
ModuleMetadata is the information required to describe a module in FyneDesk
func AvailableModules ¶ added in v0.2.0
func AvailableModules() []ModuleMetadata
AvailableModules lists all of the FyneDesk modules that were found at runtime
type Screen ¶
type Screen struct { Name string // Name is the randr provided name of the screen X, Y, Width, Height int // Geometry of the screen Scale float32 // Scale of this screen based on size and resolution }
Screen provides relative information about a single physical screen
func (*Screen) CanvasScale ¶ added in v0.2.0
CanvasScale calculates the scale for the contents of a desktop canvas on this screen
type ScreenAreaModule ¶ added in v0.2.0
type ScreenAreaModule interface { Module ScreenAreaWidget() fyne.CanvasObject }
ScreenAreaModule describes a module that can draw on the whole screen - these items will appear over the background image.
type ScreenList ¶
type ScreenList interface { RefreshScreens() // RefreshScreens asks the ScreenList implementation to reload it's data AddChangeListener(func()) // Add a change listener to be notified if the screens change Screens() []*Screen // Screens returns a Screen type slice of each available physical screen SetActive(*Screen) // Set the specified screen to be considered active Active() *Screen // Active returns the screen index of the currently active screen Primary() *Screen // Primary returns the screen index of the primary screen ScreenForWindow(Window) *Screen // Return the screen that a window is located on ScreenForGeometry(x, y, width, height int) *Screen // Return the screen that a geometry is located on }
ScreenList provides information about available physical screens for Fyne desktop
type Shortcut ¶ added in v0.2.0
type Shortcut struct { fyne.KeyName deskDriver.Modifier Name string }
Shortcut defines a keyboard shortcut that can be configured by the user
func NewShortcut ¶ added in v0.2.0
func NewShortcut(name string, key fyne.KeyName, mods deskDriver.Modifier) *Shortcut
NewShortcut creates a keyboard shortcut that can be configured by the user
func (*Shortcut) ShortcutName ¶ added in v0.2.0
ShortcutName gets the name of this shortcut - this should be user presentable
type Stack ¶
type Stack interface { AddWindow(Window) // Add a new window to the stack RaiseToTop(Window) // Request that the passed window become top of the stack. RemoveWindow(Window) // Remove a specified window from the stack TopWindow() Window // Get the currently top most window Windows() []Window // Return a list of all managed windows. This should not be modified }
Stack describes an ordered list of windows. The order of the windows in this list matches the stacking order on screen. TopWindow() returns the 0th element with each item after that being stacked below the previous.
type StackListener ¶
StackListener is used to listen for events in the window manager stack (window list). See WindowManager.AddStackListener.
type StatusAreaModule ¶ added in v0.2.0
type StatusAreaModule interface { Module StatusAreaWidget() fyne.CanvasObject }
StatusAreaModule describes a module that can add items to the status area (the bottom of the widget panel)
type Window ¶
type Window interface { Focused() bool // Is this the currently focused window? Fullscreened() bool // Is the window Fullscreen? Iconic() bool // Is the window Iconified? Maximized() bool // Is the window Maximized? TopWindow() bool // Is this the window on top? Capture() image.Image // Capture the contents of this window to an image Close() // Close this window and possibly the application running it Focus() // Ask this window to get input focus Fullscreen() // Request to fullscreen this window Iconify() // Request to iconify this window Maximize() // Request to resize this window to it's largest possible size RaiseAbove(Window) // Raise this window above a given other window RaiseToTop() // Raise this window to the top of the stack Unfullscreen() // Request to unfullscreen this window Uniconify() // Request to restore this window and possibly children of this window from being minimized Unmaximize() // Request to restore this window to its size before being maximized Properties() WindowProperties // Request the properties set on this window Position() fyne.Position }
Window represents a single managed window within a window manager. There may be borders or not depending on configuration.
type WindowManager ¶
type WindowManager interface { Stack AddStackListener(StackListener) Blank() Capture() image.Image // Capture the contents of the whole desktop to an image Close() Run() ShowOverlay(fyne.Window, fyne.Size, fyne.Position) ShowMenuOverlay(*fyne.Menu, fyne.Size, fyne.Position) }
WindowManager describes a full window manager which may be loaded as part of the setup.
type WindowProperties ¶ added in v0.2.0
type WindowProperties interface { Class() []string // The class of this window Command() string // The command of this window Decorated() bool // Should this window have borders drawn? Icon() fyne.Resource // The icon of this window IconName() string // The icon name of this window SkipTaskbar() bool // Should this window be added to the taskbar? Title() string // The name of this window }
WindowProperties encapsulates the metadata that a window can provide.