test

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2021 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAppData

func NewAppData(name string) fynedesk.AppData

NewAppData returns a new test app icon with the specified name

func NewAppProvider

func NewAppProvider(appNames ...string) fynedesk.ApplicationProvider

NewAppProvider returns a simple provider of applications from the provided list of app names

func NewScreensProvider

func NewScreensProvider(screens ...*fynedesk.Screen) fynedesk.ScreenList

NewScreensProvider returns a simple screen manager for the specified screens

Types

type Desktop

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

Desktop is an in-memory implementation for test purposes

func NewDesktop

func NewDesktop() *Desktop

NewDesktop returns a new in-memory desktop instance

func NewDesktopWithWM

func NewDesktopWithWM(wm fynedesk.WindowManager) *Desktop

NewDesktopWithWM returns a new in-memory desktop instance using the specified window manager

func (*Desktop) AddShortcut

func (*Desktop) AddShortcut(shortcut *fynedesk.Shortcut, handler func())

AddShortcut is called from modules that wish to register keyboard handlers

func (*Desktop) Capture

func (*Desktop) Capture() image.Image

Capture the desktop to an image. Our test code cowardly refuses to do this.

func (*Desktop) ContentSizePixels

func (*Desktop) ContentSizePixels(_ *fynedesk.Screen) (uint32, uint32)

ContentSizePixels returns a default value for how much space maximised apps should use

func (*Desktop) IconProvider

func (td *Desktop) IconProvider() fynedesk.ApplicationProvider

IconProvider returns the icon provider, by default it uses a simple in-memory implementation

func (*Desktop) Modules

func (*Desktop) Modules() []fynedesk.Module

Modules returns the list of modules currently loaded (by default no modules for this implementation)

func (*Desktop) RecentApps added in v0.3.0

func (td *Desktop) RecentApps() []fynedesk.AppData

RecentApps returns applications that have recently been run. This test instance returns nil.

func (*Desktop) Root

func (*Desktop) Root() fyne.Window

Root returns the root window, this is an in-memory test Fyne window

func (*Desktop) Run

func (*Desktop) Run()

Run will run the desktop mainloop - no-op for testing

func (*Desktop) RunApp

func (*Desktop) RunApp(app fynedesk.AppData) error

RunApp launches the passed application with appropriate environment setup

func (*Desktop) Screens

func (td *Desktop) Screens() fynedesk.ScreenList

Screens returns the list of screens this desktop runs on, by default a simple 2000x1000 value

func (*Desktop) SetIconProvider

func (td *Desktop) SetIconProvider(icons fynedesk.ApplicationProvider)

SetIconProvider allows tests to set the icon provider used in this desktop

func (*Desktop) Settings

func (td *Desktop) Settings() fynedesk.DeskSettings

Settings returns an in-memory test settings implementation

func (*Desktop) ShowMenuAt

func (td *Desktop) ShowMenuAt(menu *fyne.Menu, pos fyne.Position)

ShowMenuAt is used to show a menu overlay above the desktop

func (*Desktop) WindowManager

func (td *Desktop) WindowManager() fynedesk.WindowManager

WindowManager returns the window manager for this desktop, an in-memory test instance unless configured through the constructor

type Settings

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

Settings is a simple struct for managing settings within our tests

func NewSettings

func NewSettings() *Settings

NewSettings returns an in-memory settings instance

func (*Settings) AddChangeListener

func (*Settings) AddChangeListener(listener chan fynedesk.DeskSettings)

AddChangeListener is ignored for test instance

func (*Settings) Background

func (s *Settings) Background() string

Background returns the path to background image (or "" if not set)

func (*Settings) BorderButtonPosition

func (s *Settings) BorderButtonPosition() string

BorderButtonPosition returns the position of the toolbar buttons.

func (*Settings) ClockFormatting

func (s *Settings) ClockFormatting() string

ClockFormatting returns the format that the clock uses for displaying the time. Either 12h or 24h.

func (*Settings) IconTheme

func (s *Settings) IconTheme() string

IconTheme returns the configured icon theme

func (*Settings) KeyboardModifier

func (s *Settings) KeyboardModifier() deskDriver.Modifier

KeyboardModifier returns the preferred keyboard modifier for shortcuts.

func (*Settings) LauncherDisableTaskbar

func (s *Settings) LauncherDisableTaskbar() bool

LauncherDisableTaskbar returns true if the taskbar should be disabled

func (*Settings) LauncherDisableZoom

func (s *Settings) LauncherDisableZoom() bool

LauncherDisableZoom returns true if zoom is disabled on the launcher

func (*Settings) LauncherIconSize

func (s *Settings) LauncherIconSize() float32

LauncherIconSize returns the standard (non-zoomed) icon size for app launcher

func (*Settings) LauncherIcons

func (s *Settings) LauncherIcons() []string

LauncherIcons returns the names of the apps to appear in the launcher

func (*Settings) LauncherZoomScale

func (s *Settings) LauncherZoomScale() float32

LauncherZoomScale returns how much the icons should zoom when hovered

func (*Settings) ModuleNames

func (s *Settings) ModuleNames() []string

ModuleNames returns the names of modules that should be enabled

func (*Settings) SetBackground

func (s *Settings) SetBackground(bg string)

SetBackground configures a background image path, passing "" removes the configuration

func (*Settings) SetBorderButtonPosition

func (s *Settings) SetBorderButtonPosition(pos string)

SetBorderButtonPosition sets the toolbar button position.

func (*Settings) SetClockFormatting

func (s *Settings) SetClockFormatting(format string)

SetClockFormatting support setting the format that the clock should display

func (*Settings) SetIconTheme

func (s *Settings) SetIconTheme(theme string)

SetIconTheme supports setting the chosen icon theme

func (*Settings) SetLauncherDisableTaskbar

func (s *Settings) SetLauncherDisableTaskbar(bar bool)

SetLauncherDisableTaskbar allows configuring whether the taskbar should be disabled

func (*Settings) SetLauncherDisableZoom

func (s *Settings) SetLauncherDisableZoom(zoom bool)

SetLauncherDisableZoom allows configuring whether the taskbar should disable zooming

func (*Settings) SetLauncherIconSize

func (s *Settings) SetLauncherIconSize(size float32)

SetLauncherIconSize allows configuring the icon size in app launcher

func (*Settings) SetLauncherIcons

func (s *Settings) SetLauncherIcons(icons []string)

SetLauncherIcons configures the app to be included in the launcher

func (*Settings) SetLauncherZoomScale

func (s *Settings) SetLauncherZoomScale(scale float32)

SetLauncherZoomScale supports setting the scale value for hovered bar icons

func (*Settings) SetModuleNames

func (s *Settings) SetModuleNames(mods []string)

SetModuleNames supports configuring the modules that should be loaded

type Window

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

Window is an in-memory virtual window for test purposes

func NewWindow

func NewWindow(title string) *Window

NewWindow creates a virtual window with the given title ("" is acceptable)

func (*Window) Capture

func (w *Window) Capture() image.Image

Capture the contents of the window. Our test code cowardly refuses to do this.

func (*Window) ChildID

func (w *Window) ChildID() xproto.Window

ChildID returns the X window ID that this window contains

func (*Window) Close

func (w *Window) Close()

Close this test window

func (*Window) Expose

func (w *Window) Expose()

Expose is called when this window has been revealed but not changed

func (*Window) Focus

func (w *Window) Focus()

Focus sets this window to have input focus

func (*Window) Focused

func (w *Window) Focused() bool

Focused returns true if this window has requested focus

func (*Window) FrameID

func (w *Window) FrameID() xproto.Window

FrameID returns the X window ID that this frame is drawing in

func (*Window) Fullscreen

func (w *Window) Fullscreen()

Fullscreen simulates this window becoming full screen

func (*Window) Fullscreened

func (w *Window) Fullscreened() bool

Fullscreened returns true if this window has been made full screen

func (*Window) Geometry

func (w *Window) Geometry() (int, int, uint, uint)

Geometry returns the x, y position and width, height size of this window's outer bounds

func (*Window) Iconic

func (w *Window) Iconic() bool

Iconic returns true if this window has been iconified

func (*Window) Iconify

func (w *Window) Iconify()

Iconify sets this window to be reduced to an icon

func (*Window) Maximize

func (w *Window) Maximize()

Maximize simulates this window becoming maximized

func (*Window) Maximized

func (w *Window) Maximized() bool

Maximized returns true if this window has been made maximized

func (*Window) NotifyBorderChange

func (w *Window) NotifyBorderChange()

NotifyBorderChange is called when the border should be shown or hidden

func (*Window) NotifyFullscreen

func (w *Window) NotifyFullscreen()

NotifyFullscreen is called when the window is instructed to become fullscreen

func (*Window) NotifyGeometry

func (w *Window) NotifyGeometry(int, int, uint, uint)

NotifyGeometry is called when the window is instructed to change it's geometry

func (*Window) NotifyIconify

func (w *Window) NotifyIconify()

NotifyIconify is called when the window is instructed to become iconified

func (*Window) NotifyMaximize

func (w *Window) NotifyMaximize()

NotifyMaximize is called when the window is instructed to become maximized

func (*Window) NotifyMouseDrag

func (w *Window) NotifyMouseDrag(int16, int16)

NotifyMouseDrag is called when the mouse was seen to drag inside the window frame

func (*Window) NotifyMouseMotion

func (w *Window) NotifyMouseMotion(int16, int16)

NotifyMouseMotion is called when the mouse was seen to move inside the window frame

func (*Window) NotifyMousePress

func (w *Window) NotifyMousePress(int16, int16, xproto.Button)

NotifyMousePress is called when the mouse was seen to press inside the window frame

func (*Window) NotifyMouseRelease

func (w *Window) NotifyMouseRelease(int16, int16, xproto.Button)

NotifyMouseRelease is called when the mouse was seen to release inside the window frame

func (*Window) NotifyMoveResizeEnded

func (w *Window) NotifyMoveResizeEnded()

NotifyMoveResizeEnded is called to inform the window that it was moved or resized

func (*Window) NotifyUnFullscreen

func (w *Window) NotifyUnFullscreen()

NotifyUnFullscreen is called when the window is instructed to revert from fullscreen size

func (*Window) NotifyUnIconify

func (w *Window) NotifyUnIconify()

NotifyUnIconify is called when the window is instructed to return from icon form

func (*Window) NotifyUnMaximize

func (w *Window) NotifyUnMaximize()

NotifyUnMaximize is called when the window is instructed to return from maximized size

func (*Window) Position added in v0.3.0

func (w *Window) Position() fyne.Position

Position returns 0, 0 for test windows

func (*Window) Properties

func (w *Window) Properties() fynedesk.WindowProperties

Properties obtains the window properties currently set

func (*Window) QueueMoveResizeGeometry

func (w *Window) QueueMoveResizeGeometry(int, int, uint, uint)

QueueMoveResizeGeometry is called when a MoveResize event reports new geometry

func (*Window) RaiseAbove

func (w *Window) RaiseAbove(fynedesk.Window)

RaiseAbove sets this window to be above the passed window

func (*Window) RaiseToTop

func (w *Window) RaiseToTop()

RaiseToTop sets this window to be the topmost

func (*Window) Refresh

func (w *Window) Refresh()

Refresh is called when the window should update with new border state

func (*Window) SetClass

func (w *Window) SetClass(class []string)

SetClass is a test utility to set the class property of this window

func (*Window) SetCommand

func (w *Window) SetCommand(cmd string)

SetCommand is a test utility to set the command property of this window

func (*Window) SetIconName

func (w *Window) SetIconName(name string)

SetIconName is a test utility to set the icon-name property of this window

func (*Window) SettingsChanged

func (w *Window) SettingsChanged()

SettingsChanged is called on a window when the theme or icon set changes

func (*Window) SizeMax

func (w *Window) SizeMax() (int, int)

SizeMax returns the maximum size this window can become (which may disable maximize)

func (*Window) SizeMin

func (w *Window) SizeMin() (uint, uint)

SizeMin returns the minimum size this window allows

func (*Window) TopWindow

func (w *Window) TopWindow() bool

TopWindow returns true if this window has been raised above all others

func (*Window) Unfullscreen

func (w *Window) Unfullscreen()

Unfullscreen removes the fullscreen state of this window

func (*Window) Uniconify

func (w *Window) Uniconify()

Uniconify returns this window to its normal state

func (*Window) Unmaximize

func (w *Window) Unmaximize()

Unmaximize removes the maximized state of this window

Jump to

Keyboard shortcuts

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