mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-07 02:15:34 +00:00
all: [API] replace tag parameter of Source.Event with per-filter tags
Until now, every event has had a particular target. We're about to simplify key event delivery to match the first matching filter, so there is no longer a global meaning to the tag argument to Source.Event. Add fields to filters to specify their target tags. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -42,6 +42,8 @@ func (OfferCmd) ImplementsCommand() {}
|
||||
// as well as [InitiateEvent] and [CancelEvent].
|
||||
// Use multiple filters to offer multiple types.
|
||||
type SourceFilter struct {
|
||||
// Target is a tag included in a previous event.Op.
|
||||
Target event.Tag
|
||||
// Type is the MIME type supported by this source.
|
||||
Type string
|
||||
}
|
||||
@@ -49,6 +51,8 @@ type SourceFilter struct {
|
||||
// TargetFilter filters for any [DataEvent] whose type matches a MIME type
|
||||
// as well as [CancelEvent]. Use multiple filters to accept multiple types.
|
||||
type TargetFilter struct {
|
||||
// Target is a tag included in a previous event.Op.
|
||||
Target event.Tag
|
||||
// Type is the MIME type accepted by this target.
|
||||
Type string
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user