Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update root package GoDoc to include internal links #5127

Merged
merged 1 commit into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion animation.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ type Animation struct {
}

// NewAnimation creates a very basic animation where the callback function will be called for every
// rendered frame between time.Now() and the specified duration. The callback values start at 0.0 and
// rendered frame between [time.Now] and the specified duration. The callback values start at 0.0 and
// will be 1.0 when the animation completes.
//
// Since: 2.0
Expand Down
12 changes: 6 additions & 6 deletions app.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (

// An App is the definition of a graphical application.
// Apps can have multiple windows, by default they will exit when all windows
// have been closed. This can be modified using SetMaster() or SetCloseIntercept().
// To start an application you need to call Run() somewhere in your main() function.
// Alternatively use the window.ShowAndRun() function for your main window.
// have been closed. This can be modified using SetMaster or SetCloseIntercept.
// To start an application you need to call Run somewhere in your main function.
// Alternatively use the [fyne.io/fyne/v2.Window.ShowAndRun] function for your main window.
type App interface {
// Create a new window for the application.
// The first window to open is considered the "master" and when closed
Expand All @@ -27,7 +27,7 @@ type App interface {
// SetIcon sets the icon resource used for this application instance.
SetIcon(Resource)

// Run the application - this starts the event loop and waits until Quit()
// Run the application - this starts the event loop and waits until [App.Quit]
// is called or the last window closes.
// This should be called near the end of a main() function as it will block.
Run()
Expand All @@ -43,7 +43,7 @@ type App interface {
Driver() Driver

// UniqueID returns the application unique identifier, if set.
// This must be set for use of the Preferences() functions... see NewWithId(string)
// This must be set for use of the [App.Preferences]. see [NewWithID].
UniqueID() string

// SendNotification sends a system notification that will be displayed in the operating system's notification area.
Expand Down Expand Up @@ -75,7 +75,7 @@ type App interface {
CloudProvider() CloudProvider // get the (if any) configured provider

// SetCloudProvider allows developers to specify how this application should integrate with cloud services.
// See `fyne.io/cloud` package for implementation details.
// See [fyne.io/cloud] package for implementation details.
//
// Since: 2.3
SetCloudProvider(CloudProvider) // configure cloud for this app
Expand Down
4 changes: 2 additions & 2 deletions canvas.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package fyne

import "image"

// Canvas defines a graphical canvas to which a CanvasObject or Container can be added.
// Canvas defines a graphical canvas to which a [CanvasObject] or Container can be added.
// Each canvas has a scale which is automatically applied during the render process.
type Canvas interface {
Content() CanvasObject
Expand Down Expand Up @@ -31,7 +31,7 @@ type Canvas interface {
// Size returns the current size of this canvas
Size() Size
// Scale returns the current scale (multiplication factor) this canvas uses to render
// The pixel size of a CanvasObject can be found by multiplying by this value.
// The pixel size of a [CanvasObject] can be found by multiplying by this value.
Scale() float32

// Overlays returns the overlay stack.
Expand Down
18 changes: 9 additions & 9 deletions canvasobject.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,27 +36,27 @@ type CanvasObject interface {
Refresh()
}

// Disableable describes any CanvasObject that can be disabled.
// Disableable describes any [CanvasObject] that can be disabled.
// This is primarily used with objects that also implement the Tappable interface.
type Disableable interface {
Enable()
Disable()
Disabled() bool
}

// DoubleTappable describes any CanvasObject that can also be double tapped.
// DoubleTappable describes any [CanvasObject] that can also be double tapped.
type DoubleTappable interface {
DoubleTapped(*PointEvent)
}

// Draggable indicates that a CanvasObject can be dragged.
// Draggable indicates that a [CanvasObject] can be dragged.
// This is used for any item that the user has indicated should be moved across the screen.
type Draggable interface {
Dragged(*DragEvent)
DragEnd()
}

// Focusable describes any CanvasObject that can respond to being focused.
// Focusable describes any [CanvasObject] that can respond to being focused.
// It will receive the FocusGained and FocusLost events appropriately.
// When focused it will also have TypedRune called as text is input and
// TypedKey called when other keys are pressed.
Expand All @@ -75,18 +75,18 @@ type Focusable interface {
TypedKey(*KeyEvent)
}

// Scrollable describes any CanvasObject that can also be scrolled.
// Scrollable describes any [CanvasObject] that can also be scrolled.
// This is mostly used to implement the widget.ScrollContainer.
type Scrollable interface {
Scrolled(*ScrollEvent)
}

// SecondaryTappable describes a CanvasObject that can be right-clicked or long-tapped.
// SecondaryTappable describes a [CanvasObject] that can be right-clicked or long-tapped.
type SecondaryTappable interface {
TappedSecondary(*PointEvent)
}

// Shortcutable describes any CanvasObject that can respond to shortcut commands (quit, cut, copy, and paste).
// Shortcutable describes any [CanvasObject] that can respond to shortcut commands (quit, cut, copy, and paste).
type Shortcutable interface {
TypedShortcut(Shortcut)
}
Expand All @@ -95,12 +95,12 @@ type Shortcutable interface {
//
// Since: 2.1
type Tabbable interface {
// AcceptsTab() is a hook called by the key press handling logic.
// AcceptsTab is a hook called by the key press handling logic.
// If it returns true then the Tab key events will be sent using TypedKey.
AcceptsTab() bool
}

// Tappable describes any CanvasObject that can also be tapped.
// Tappable describes any [CanvasObject] that can also be tapped.
// This should be implemented by buttons etc that wish to handle pointer interactions.
type Tappable interface {
Tapped(*PointEvent)
Expand Down
2 changes: 1 addition & 1 deletion cloud.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package fyne

// CloudProvider specifies the identifying information of a cloud provider.
// This information is mostly used by the `fyne.io/cloud ShowSettings' user flow.
// This information is mostly used by the [fyne.io/cloud.ShowSettings] user flow.
//
// Since: 2.3
type CloudProvider interface {
Expand Down
40 changes: 20 additions & 20 deletions container.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,32 @@ package fyne

import "sync"

// Declare conformity to CanvasObject
// Declare conformity to [CanvasObject]
var _ CanvasObject = (*Container)(nil)

// Container is a CanvasObject that contains a collection of child objects.
// Container is a [CanvasObject] that contains a collection of child objects.
// The layout of the children is set by the specified Layout.
type Container struct {
size Size // The current size of the Container
position Position // The current position of the Container
Hidden bool // Is this Container hidden

Layout Layout // The Layout algorithm for arranging child CanvasObjects
Layout Layout // The Layout algorithm for arranging child [CanvasObject]s
lock sync.Mutex
Objects []CanvasObject // The set of CanvasObjects this container holds
Objects []CanvasObject // The set of [CanvasObject]s this container holds
}

// NewContainer returns a new Container instance holding the specified CanvasObjects.
// NewContainer returns a new [Container] instance holding the specified [CanvasObject]s.
//
// Deprecated: Use container.NewWithoutLayout() to create a container that uses manual layout.
// Deprecated: Use [fyne.io/fyne/v2/container.NewWithoutLayout] to create a container that uses manual layout.
func NewContainer(objects ...CanvasObject) *Container {
return NewContainerWithoutLayout(objects...)
}

// NewContainerWithoutLayout returns a new Container instance holding the specified
// CanvasObjects that are manually arranged.
// NewContainerWithoutLayout returns a new [Container] instance holding the specified
// [CanvasObject]s that are manually arranged.
//
// Deprecated: Use container.NewWithoutLayout() instead
// Deprecated: Use [fyne.io/fyne/v2/container.NewWithoutLayout] instead.
func NewContainerWithoutLayout(objects ...CanvasObject) *Container {
ret := &Container{
Objects: objects,
Expand All @@ -37,10 +37,10 @@ func NewContainerWithoutLayout(objects ...CanvasObject) *Container {
return ret
}

// NewContainerWithLayout returns a new Container instance holding the specified
// CanvasObjects which will be laid out according to the specified Layout.
// NewContainerWithLayout returns a new [Container] instance holding the specified
// [CanvasObject]s which will be laid out according to the specified Layout.
//
// Deprecated: Use container.New() instead
// Deprecated: Use [fyne.io/fyne/v2/container.New] instead.
func NewContainerWithLayout(layout Layout, objects ...CanvasObject) *Container {
ret := &Container{
Objects: objects,
Expand All @@ -66,9 +66,9 @@ func (c *Container) Add(add CanvasObject) {
c.layout()
}

// AddObject adds another CanvasObject to the set this Container holds.
// AddObject adds another [CanvasObject] to the set this Container holds.
//
// Deprecated: Use replacement Add() function
// Deprecated: Use [Container.Add] instead.
func (c *Container) AddObject(o CanvasObject) {
c.Add(o)
}
Expand All @@ -83,8 +83,8 @@ func (c *Container) Hide() {
repaint(c)
}

// MinSize calculates the minimum size of a Container.
// This is delegated to the Layout, if specified, otherwise it will mimic MaxLayout.
// MinSize calculates the minimum size of c.
// This is delegated to the [Container.Layout], if specified, otherwise it will be calculated.
func (c *Container) MinSize() Size {
if c.Layout != nil {
return c.Layout.MinSize(c.Objects)
Expand All @@ -104,7 +104,7 @@ func (c *Container) Move(pos Position) {
repaint(c)
}

// Position gets the current position of this Container, relative to its parent.
// Position gets the current position of c relative to its parent.
func (c *Container) Position() Position {
return c.position
}
Expand All @@ -127,7 +127,7 @@ func (c *Container) Refresh() {

// Remove updates the contents of this container to no longer include the specified object.
// This method is not intended to be used inside a loop, to remove all the elements.
// It is much more efficient to call RemoveAll() instead.
// It is much more efficient to call [Container.RemoveAll) instead.
func (c *Container) Remove(rem CanvasObject) {
c.lock.Lock()
defer c.lock.Unlock()
Expand Down Expand Up @@ -158,7 +158,7 @@ func (c *Container) RemoveAll() {
c.layout()
}

// Resize sets a new size for the Container.
// Resize sets a new size for c.
func (c *Container) Resize(size Size) {
if c.size == size {
return
Expand All @@ -177,7 +177,7 @@ func (c *Container) Show() {
c.Hidden = false
}

// Size returns the current size of this container.
// Size returns the current size c.
func (c *Container) Size() Size {
return c.size
}
Expand Down
6 changes: 3 additions & 3 deletions driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ type Driver interface {
// If the source is specified it will be used, otherwise the current theme will be asked for the font.
RenderedTextSize(text string, fontSize float32, style TextStyle, source Resource) (size Size, baseline float32)

// CanvasForObject returns the canvas that is associated with a given CanvasObject.
// CanvasForObject returns the canvas that is associated with a given [CanvasObject].
CanvasForObject(CanvasObject) Canvas
// AbsolutePositionForObject returns the position of a given CanvasObject relative to the top/left of a canvas.
// AbsolutePositionForObject returns the position of a given [CanvasObject] relative to the top/left of a canvas.
AbsolutePositionForObject(CanvasObject) Position

// Device returns the device that the application is currently running on.
Expand All @@ -34,7 +34,7 @@ type Driver interface {
StopAnimation(*Animation)

// DoubleTapDelay returns the maximum duration where a second tap after a first one
// will be considered a DoubleTap instead of two distinct Tap events.
// will be considered a [DoubleTap] instead of two distinct [Tap] events.
//
// Since: 2.5
DoubleTapDelay() time.Duration
Expand Down
4 changes: 2 additions & 2 deletions event.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package fyne

// HardwareKey contains information associated with physical key events
// Most applications should use KeyName for cross-platform compatibility.
// Most applications should use [KeyName] for cross-platform compatibility.
type HardwareKey struct {
// ScanCode represents a hardware ID for (normally desktop) keyboard events.
ScanCode int
Expand All @@ -16,7 +16,7 @@ type KeyEvent struct {
}

// PointEvent describes a pointer input event. The position is relative to the
// top-left of the CanvasObject this is triggered on.
// top-left of the [CanvasObject] this is triggered on.
type PointEvent struct {
AbsolutePosition Position // The absolute position of the event
Position Position // The relative position of the event
Expand Down
Loading