wm

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2024 License: BSD-3-Clause Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CloseCursor is the mouse cursor that indicates a close action
	CloseCursor desktop.StandardCursor = iota + desktop.VResizeCursor // add to the end of the fyne list
)

Variables

This section is empty.

Functions

func CallMethod

func CallMethod(in []interface{}, path, iface, meth string) ([]interface{}, error)

CallMethod simplifies calling a function on the DBus message system. The name of the method and its interface and path are passed as strings. The in parameters must be in the correct number and type to match the requested method and the returned parameters will be returned from this method. If an error occurred the last return parameter will be set.

func FindObjectAtPixelPositionMatching

func FindObjectAtPixelPositionMatching(x, y int, c fyne.Canvas, fn func(fyne.CanvasObject) bool) fyne.CanvasObject

FindObjectAtPixelPositionMatching looks for objects in the given canvas that are under pixel position at x, y. Objects must match the criteria in 'fn' and the first match will be returned.

func PositionForNewWindow

func PositionForNewWindow(win fynedesk.Window, x, y int, w, h uint, decorated bool,
	screens fynedesk.ScreenList) (int, int, uint, uint)

PositionForNewWindow returns the suggested position for a new window of the given geometry. The screen list hints at available space, but normally list.Active() is the best.

func RegisterService

func RegisterService(obj interface{}, path, iface string) error

RegisterService allows an object to be exported to the DBus messaging system. Methods on the object exposed can add an additional error parameter to the return types, in which case a non-nil error will send an error message instead of the object response.

func ScaleToPixels

func ScaleToPixels(i float32, screen *fynedesk.Screen) int

ScaleToPixels calculates the pixels required to show a specified Fyne dimension on the given screen

func SendNotification

func SendNotification(n *Notification)

SendNotification posts a given notification into the user interface's notification area

func SetNotificationListener

func SetNotificationListener(listen func(*Notification))

SetNotificationListener connects the user interface to display notifications. Other developers should not use this call.

func StartAuthAgent

func StartAuthAgent()

StartAuthAgent asks our policy kit agent to start listening for auth requests.

Types

type Border

type Border struct {
	widget.BaseWidget
	// contains filtered or unexported fields
}

Border represents a window border. It draws the title bar and provides functions to manipulate it.

func NewBorder

func NewBorder(win fynedesk.Window, icon fyne.Resource, canMaximize bool) *Border

NewBorder creates a new window border for the given window details

func (*Border) CreateRenderer

func (c *Border) CreateRenderer() fyne.WidgetRenderer

CreateRenderer creates a new renderer for this border

Implements: fyne.Widget

func (*Border) DoubleTapped

func (c *Border) DoubleTapped(*fyne.PointEvent)

DoubleTapped is called when the user double taps a frame, it toggles the maximised state.

func (*Border) SetIcon

func (c *Border) SetIcon(icon fyne.Resource)

SetIcon tells the border to change the icon that should be used

func (*Border) SetMaximized

func (c *Border) SetMaximized(isMax bool)

SetMaximized updates the state of the border maximize indicators and refreshes

func (*Border) SetTitle

func (c *Border) SetTitle(title string)

SetTitle updates the title portion of this border and refreshes.

type Notification

type Notification struct {
	ID          uint32
	Title, Body string
}

Notification is a simple struct representing message that can be displayed in the notification area

func NewNotification

func NewNotification(title, body string) *Notification

NewNotification creates a new message that can be passed to SendNotification

type ShortcutHandler

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

ShortcutHandler is a simple implementation for tracking registered shortcuts

func (*ShortcutHandler) AddShortcut

func (sh *ShortcutHandler) AddShortcut(shortcut *fynedesk.Shortcut, handler func())

AddShortcut register an handler to be executed when the shortcut action is triggered

func (*ShortcutHandler) Shortcuts

func (sh *ShortcutHandler) Shortcuts() []*fynedesk.Shortcut

Shortcuts returns the list of all registered shortcuts

func (*ShortcutHandler) TypedShortcut

func (sh *ShortcutHandler) TypedShortcut(shortcut fyne.Shortcut)

TypedShortcut handle the registered shortcut

type ShortcutManager

type ShortcutManager interface {
	Shortcuts() []*fynedesk.Shortcut
	TypedShortcut(fyne.Shortcut)
}

ShortcutManager is an interface that we can use to check for the handler capabilities of a desktop

Jump to

Keyboard shortcuts

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