imgviewer

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2024 License: GPL-3.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

func Decode(reader io.ReadSeeker) (image.Image, string, error)

func IsArchiveFromPath

func IsArchiveFromPath(path string) bool

func IsImage

func IsImage(file io.Reader) bool

func IsImageFromPath

func IsImageFromPath(path string) bool

func ReadDir

func ReadDir(imgPath string) (string, []fs.DirEntry, int)

Types

type Config

type Config struct {
	Image   ImageConfig
	Gallery GalleryConfig
	General GeneralConfig
}

type CornerKnob

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

func NewCornerKnob

func NewCornerKnob(cornerPosition uint, parent *Region) *CornerKnob

func (*CornerKnob) CreateRenderer

func (r *CornerKnob) CreateRenderer() fyne.WidgetRenderer

func (*CornerKnob) DragEnd

func (ck *CornerKnob) DragEnd()

func (*CornerKnob) Dragged

func (ck *CornerKnob) Dragged(drag *fyne.DragEvent)

type CustomReader

type CustomReader interface {
	GetReader() (io.ReadSeeker, error)
	Path() string // Used for caching and identification
}

type GalleryConfig

type GalleryConfig struct {
	Quit        []fyne.KeyName
	ScrollDown  []fyne.KeyName
	ScrollUp    []fyne.KeyName
	PathLevelUp []fyne.KeyName
}

type GeneralConfig

type GeneralConfig struct {
	ThumbnailDir  string
	DefaultWidth  float32
	DefaultHeight float32
	TileWidth     float32
	TileGap       float32
	Workers       int
	ImagesPerPage int
}

type Hotkey

type Hotkey struct {
	Name    fyne.KeyName
	Functon func()
}

type ImageConfig

type ImageConfig struct {
	NextImage     []fyne.KeyName
	PreviousImage []fyne.KeyName
	RotateLeft    []fyne.KeyName
	RotateRight   []fyne.KeyName
	OriginalSize  []fyne.KeyName
	FillWindow    []fyne.KeyName
	Filtering     []fyne.KeyName
	ShowGallery   []fyne.KeyName
	Quit          []fyne.KeyName
	FullScreen    []fyne.KeyName
	RunCmda       []fyne.KeyName
	CmdA          string
	SaveImage     []fyne.KeyName
	SaveDir       string
}

type ImageInfo

type ImageInfo struct {
	Path              string
	FullPath          string // Used to get path of zipFile
	ShowArchive       bool
	CustomReader      CustomReader
	OnTapped          func()
	OnDoubleTapped    func()
	OnTappedSecondary func()

	InputIsArchive    bool
	InputIsDir        bool
	InputIsReader     bool
	IsZoomable        bool
	IsDraggable       bool
	ThumbnailIsScaled bool
	// contains filtered or unexported fields
}

func NewImageInfo

func NewImageInfo(order int, path string) *ImageInfo

func NewImageInfoCustomReader

func NewImageInfoCustomReader(order int, r CustomReader) *ImageInfo

func (*ImageInfo) GetReader

func (img *ImageInfo) GetReader() (io.ReadSeeker, error)

type ImageLayout

type ImageLayout struct{}

func (*ImageLayout) Layout

func (d *ImageLayout) Layout(objects []fyne.CanvasObject, containerSize fyne.Size)

func (*ImageLayout) MinSize

func (d *ImageLayout) MinSize(objects []fyne.CanvasObject) fyne.Size

type ImageView

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

func NewImageView

func NewImageView(info *ImageInfo, size fyne.Size, hideRegion bool, w fyne.Window, focusFunc func(fyne.Focusable)) *ImageView

func (*ImageView) CreateRenderer

func (r *ImageView) CreateRenderer() fyne.WidgetRenderer

func (*ImageView) DoubleTapped

func (iv *ImageView) DoubleTapped(_ *fyne.PointEvent)

func (*ImageView) DragEnd

func (iv *ImageView) DragEnd()

func (*ImageView) Dragged

func (iv *ImageView) Dragged(drag *fyne.DragEvent)

func (*ImageView) FocusGained

func (iv *ImageView) FocusGained()

func (*ImageView) FocusLost

func (iv *ImageView) FocusLost()

func (*ImageView) GetImageInfo

func (iv *ImageView) GetImageInfo() string

func (*ImageView) GetZoomLevel

func (iv *ImageView) GetZoomLevel() int

func (*ImageView) LoadImage

func (iv *ImageView) LoadImage() error

func (*ImageView) OriginalSize

func (iv *ImageView) OriginalSize()

func (*ImageView) RegisterKey

func (e *ImageView) RegisterKey(name fyne.KeyName, function func())

func (*ImageView) Resize

func (iv *ImageView) Resize(size fyne.Size)

func (*ImageView) RotateLeft

func (iv *ImageView) RotateLeft()

func (*ImageView) RotateRight

func (iv *ImageView) RotateRight()

func (*ImageView) Scrolled

func (iv *ImageView) Scrolled(ev *fyne.ScrollEvent)

func (*ImageView) Tapped

func (iv *ImageView) Tapped(_ *fyne.PointEvent)

func (*ImageView) TappedSecondary

func (iv *ImageView) TappedSecondary(_ *fyne.PointEvent)

func (*ImageView) TypedKey

func (iv *ImageView) TypedKey(key *fyne.KeyEvent)

func (*ImageView) TypedRune

func (iv *ImageView) TypedRune(r rune)

type ImageViewRenderer

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

**************************** ** RENDERER ****************************

func (*ImageViewRenderer) Destroy

func (r *ImageViewRenderer) Destroy()

Refresh causes this object to be redrawn in it's current state

func (*ImageViewRenderer) Layout

func (ren *ImageViewRenderer) Layout(s fyne.Size)

func (*ImageViewRenderer) MinSize

func (ren *ImageViewRenderer) MinSize() fyne.Size

func (*ImageViewRenderer) Objects

func (ren *ImageViewRenderer) Objects() []fyne.CanvasObject

func (*ImageViewRenderer) Refresh

func (ren *ImageViewRenderer) Refresh()

type ImageViewer

type ImageViewer struct {
	Content       *fyne.Container
	CurrentImage  *fyne.Container
	CustomReaders []CustomReader
	TieMode       bool
	Tie           *client.TieClient

	CurrentImageView *ImageView

	OnTapped          func()
	OnDoubleTapped    func()
	OnTappedSecondary func()
	OnImageChange     func(info *ImageInfo)
	// contains filtered or unexported fields
}

func NewImageViewer

func NewImageViewer(app fyne.App, window fyne.Window, config Config, tileOnclick func(t *Tile)) *ImageViewer

func (*ImageViewer) ChangeGallery

func (viewer *ImageViewer) ChangeGallery()

func (*ImageViewer) ChangeImage

func (viewer *ImageViewer) ChangeImage(info *ImageInfo)

func (*ImageViewer) ChangePage

func (viewer *ImageViewer) ChangePage(page int)

func (*ImageViewer) CreateView

func (viewer *ImageViewer) CreateView()

func (*ImageViewer) CurrentImageInfo

func (viewer *ImageViewer) CurrentImageInfo() *ImageInfo

func (*ImageViewer) Init

func (viewer *ImageViewer) Init()

func (*ImageViewer) InitHotkeys

func (viewer *ImageViewer) InitHotkeys()

func (*ImageViewer) KeyPress

func (viewer *ImageViewer) KeyPress(key *fyne.KeyEvent)

func (*ImageViewer) LoadGallery

func (viewer *ImageViewer) LoadGallery()

func (*ImageViewer) LoadImageToCache

func (viewer *ImageViewer) LoadImageToCache(info *ImageInfo) *ImageView

func (*ImageViewer) MakeTieSidebar

func (viewer *ImageViewer) MakeTieSidebar(mainPage fyne.CanvasObject) fyne.CanvasObject

func (*ImageViewer) NextImage

func (viewer *ImageViewer) NextImage() *ImageInfo

func (*ImageViewer) PrevImage

func (viewer *ImageViewer) PrevImage() *ImageInfo

func (*ImageViewer) ReadCustom

func (viewer *ImageViewer) ReadCustom()

func (*ImageViewer) ReadFromTie

func (viewer *ImageViewer) ReadFromTie(include, exclude []string, filter string)

func (*ImageViewer) ReadImageArchive

func (viewer *ImageViewer) ReadImageArchive(zipFile string)

func (*ImageViewer) ReadImageDir

func (viewer *ImageViewer) ReadImageDir(absolutePath string, selected *ImageInfo)

func (*ImageViewer) RunCmdA

func (viewer *ImageViewer) RunCmdA()

func (*ImageViewer) SaveImage

func (viewer *ImageViewer) SaveImage()

func (*ImageViewer) ShowImageArchive

func (viewer *ImageViewer) ShowImageArchive(path string)

func (*ImageViewer) ShowImageDir

func (viewer *ImageViewer) ShowImageDir(path string)

func (*ImageViewer) ToggleFullscreen

func (viewer *ImageViewer) ToggleFullscreen()

type Region

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

func NewRegion

func NewRegion(color color.Color, parent *ImageView) *Region

func (*Region) CreateRenderer

func (r *Region) CreateRenderer() fyne.WidgetRenderer

func (*Region) DragEnd

func (r *Region) DragEnd()

func (*Region) Dragged

func (r *Region) Dragged(drag *fyne.DragEvent)

type RegionRenderer

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

func (*RegionRenderer) Destroy

func (r *RegionRenderer) Destroy()

Refresh causes this object to be redrawn in it's current state

func (*RegionRenderer) Layout

func (ren *RegionRenderer) Layout(s fyne.Size)

func (*RegionRenderer) MinSize

func (ren *RegionRenderer) MinSize() fyne.Size

func (*RegionRenderer) Objects

func (ren *RegionRenderer) Objects() []fyne.CanvasObject

func (*RegionRenderer) Refresh

func (ren *RegionRenderer) Refresh()

type Tile

type Tile struct {
	widget.BaseWidget
	Content *canvas.Image

	Viewer *ImageViewer
	Info   *ImageInfo
	// contains filtered or unexported fields
}

func (*Tile) CreateRenderer

func (ta *Tile) CreateRenderer() fyne.WidgetRenderer

func (*Tile) Tapped

func (t *Tile) Tapped(_ *fyne.PointEvent)

type TileLayout

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

func NewTileLayout

func NewTileLayout(config Config, window fyne.Window, app fyne.App, viewer *ImageViewer, tabFn func(t *Tile)) *TileLayout

func (*TileLayout) Clear

func (layout *TileLayout) Clear()

func (*TileLayout) GetThumbnail added in v0.1.1

func (layout *TileLayout) GetThumbnail(context *ImageInfo) (io.ReadSeeker, error)

func (*TileLayout) InitHotkeys

func (layout *TileLayout) InitHotkeys()

func (*TileLayout) Layout

func (layout *TileLayout) Layout(objects []fyne.CanvasObject, containerSize fyne.Size)

func (*TileLayout) MinSize

func (layout *TileLayout) MinSize(objects []fyne.CanvasObject) fyne.Size

func (*TileLayout) NewImageTile

func (layout *TileLayout) NewImageTile(reader io.ReadSeeker, context *ImageInfo, tabFn func(t *Tile)) (*Tile, error)

func (*TileLayout) PlaceTiles

func (layout *TileLayout) PlaceTiles(imageFiles []*ImageInfo)

Directories

Path Synopsis
TestIncludeExclude project main.go
TestIncludeExclude project main.go

Jump to

Keyboard shortcuts

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