Add ApplicationURLOpener interface
Eventually we can have nasin parse cli args and figure out what files to open, instructing the application to open those files. We will also be able to have nasin connect to dbus using the application ID and open files in an already running instance of the application.
This commit is contained in:
parent
d5d9f3abfb
commit
1bc08bcfe4
@ -3,6 +3,7 @@ package nasin
|
||||
import "log"
|
||||
import "image"
|
||||
import "strings"
|
||||
import "net/url"
|
||||
import "git.tebibyte.media/tomo/tomo"
|
||||
import "git.tebibyte.media/tomo/nasin/internal/registrar"
|
||||
|
||||
@ -15,6 +16,20 @@ type Application interface {
|
||||
Init () error
|
||||
}
|
||||
|
||||
// ApplicationURLOpener is an application that can open a URL.
|
||||
type ApplicationURLOpener interface {
|
||||
Application
|
||||
|
||||
// OpenURL opens a new window with the contents of the given URL. If the
|
||||
// given URL is unsupported, it returns an error (for example, an image
|
||||
// viewer is not expected to open a text file). If the URL scheme is
|
||||
// empty, file:// is assumed.
|
||||
//
|
||||
// Applications should support the file:// scheme at the very least, and
|
||||
// should also support others like http:// and https:// if possible.
|
||||
OpenURL (*url.URL) error
|
||||
}
|
||||
|
||||
// ApplicationDescription describes the name and type of an application.
|
||||
type ApplicationDescription struct {
|
||||
// The name of the application.
|
||||
|
Loading…
Reference in New Issue
Block a user