app

package
v1.7.2 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2023 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Overview

Package app implements the xkcd-gtk application.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Name

func Name() string

Name is the user-visible name of this application.

Types

type Application

type Application struct {
	*gtk.Application
	// contains filtered or unexported fields
}

Application holds onto our GTK representation of our application.

func New

func New(appID string, flags glib.ApplicationFlags) (*Application, error)

New creates an instance of our GTK Application.

func (*Application) Activate

func (app *Application) Activate()

Activate creates and presents a new window to the user.

func (*Application) BookmarksList

func (app *Application) BookmarksList() *bookmarks.List

BookmarksList returns a pointer to the app's list of bookmarks.

func (*Application) CacheWindowVR

func (app *Application) CacheWindowVR() cache.ViewRefresher

func (*Application) CacheWindowVRW

func (app *Application) CacheWindowVRW() cache.ViewRefreshWither

func (*Application) CloseCache

func (app *Application) CloseCache()

CloseCache closes the search index and comic cache.

func (*Application) ConnectDarkModeChanged

func (app *Application) ConnectDarkModeChanged(f any) glib.SignalHandle

ConnectDarkModeChanged connects the given signal handler to the dark mode GTK signal.

func (*Application) DarkMode

func (app *Application) DarkMode() bool

DarkMode returns whether the application has dark mode enabled.

func (*Application) DarkModeChanged

func (app *Application) DarkModeChanged()

DarkModeChanged is called when gtk-application-prefer-dark-theme is changed.

func (*Application) GtkApplication

func (app *Application) GtkApplication() *gtk.Application

GtkApplication returns the underlying gtk.Application struct.

func (*Application) GtkTheme

func (app *Application) GtkTheme() (string, error)

GtkTheme returns the name of the GTK theme that the application should use.

func (*Application) LoadBookmarks

func (app *Application) LoadBookmarks()

LoadBookmarks tries to load our bookmarks from disk.

func (*Application) LoadSettings

func (app *Application) LoadSettings()

LoadSettings tries to load our settings from disk.

func (*Application) OpenAboutXKCD

func (app *Application) OpenAboutXKCD()

OpenAboutXKCD opens aboutLink in the user's web browser.

func (*Application) OpenBlog

func (app *Application) OpenBlog()

OpenBlog opens blogLink in the user's web browser.

func (*Application) OpenBooks

func (app *Application) OpenBooks()

OpenBooks opens booksLink in the user's web browser.

func (*Application) OpenURL

func (app *Application) OpenURL(url string) error

OpenURL opens the given URL in the user's web browser. The function logs errors in addition to returning them, so errors can be ignored if that is all that would be done with the returned error.

func (*Application) OpenWhatIf

func (app *Application) OpenWhatIf()

OpenWhatIf opens whatifLink in the user's web browser.

func (*Application) PleaseQuit

func (app *Application) PleaseQuit()

PleaseQuit closes all windows so that the application will exit. Main functional difference with Quit is that PleaseQuit gives windows the opportunity to save state before the application exits.

func (*Application) PrefersAppMenu

func (app *Application) PrefersAppMenu() bool

PrefersAppMenu is a wrapper around gtk.Application.PrefersAppMenu().

func (*Application) SaveBookmarks

func (app *Application) SaveBookmarks()

SaveBookmarks tries to save our bookmarks to disk.

func (*Application) SaveSettings

func (app *Application) SaveSettings()

SaveSettings tries to save our settings to disk.

func (*Application) SetDarkMode

func (app *Application) SetDarkMode(darkMode bool)

SetDarkMode sets the value of "gtk-application-prefer-dark-theme" to the darkMode argument.

func (*Application) SetupAppMenu

func (app *Application) SetupAppMenu() error

SetupAppMenu creates an AppMenu if the environment wants it.

func (*Application) SetupCache

func (app *Application) SetupCache()

SetupCache initializes the comic cache and the search index.

func (*Application) ShowAbout

func (app *Application) ShowAbout()

ShowAbout shows our application info to the user.

func (*Application) ShowCache

func (app *Application) ShowCache()

ShowCache shows the cache management window to the user.

func (*Application) ShowShortcuts

func (app *Application) ShowShortcuts()

ShowShortcuts shows a shortcuts window to the user.

func (*Application) Shutdown

func (app *Application) Shutdown()

Shutdown is called when the "shutdown" signal is emitted.

func (*Application) Startup

func (app *Application) Startup()

Startup is called when the "startup" signal is emitted.

func (*Application) ToggleDarkMode

func (app *Application) ToggleDarkMode()

ToggleDarkMode toggles the value of "gtk-application-prefer-dark-theme".

Jump to

Keyboard shortcuts

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