Files

60 lines
3.9 KiB
Go

// Cthulhu screen reader.
// Copyright (c) 2026 Storm Dragon
// Authors: Storm Dragon, Angus Kola
//
// This program is free software: you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by the Free
// Software Foundation, either version 3 of the License, or (at your option)
// any later version.
// This program is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
// more details.
// You should have received a copy of the GNU General Public License along with
// this program. If not, see <https://www.gnu.org/licenses/gpl-3.0.html>.
// Package remote publishes Cthulhu's bounded self-voice D-Bus API.
package remote
import (
"github.com/godbus/dbus/v5/introspect"
)
func introspectionMethods() []introspect.Method {
return serviceMethods(false)
}
func serviceMethods(orca bool) []introspect.Method {
methods := []introspect.Method{
{Name: "ShowPreferences", Args: []introspect.Arg{{Name: "accepted", Type: "b", Direction: "out"}}},
{Name: "GetVersion", Args: []introspect.Arg{{Name: "version", Type: "s", Direction: "out"}}},
{Name: "Quit", Args: []introspect.Arg{{Name: "accepted", Type: "b", Direction: "out"}}},
{Name: "PresentMessage", Args: []introspect.Arg{{Name: "message", Type: "s", Direction: "in"}, {Name: "accepted", Type: "b", Direction: "out"}}},
}
if orca {
return append(methods, introspect.Method{Name: "ListModules", Args: []introspect.Arg{{Name: "modules", Type: "as", Direction: "out"}}}, introspect.Method{Name: "ListCommands", Args: []introspect.Arg{{Name: "commands", Type: "a(ss)", Direction: "out"}}})
}
return append(methods,
introspect.Method{Name: "RegisterWineReviewProvider", Args: []introspect.Arg{{Name: "path", Type: "o", Direction: "in"}, {Name: "version", Type: "u", Direction: "in"}, {Name: "accepted", Type: "b", Direction: "out"}}},
introspect.Method{Name: "PresentWineReviewFocus", Args: []introspect.Arg{
{Name: "instance", Type: "s", Direction: "in"}, {Name: "window", Type: "s", Direction: "in"}, {Name: "focus", Type: "s", Direction: "in"}, {Name: "revision", Type: "t", Direction: "in"},
{Name: "title", Type: "s", Direction: "in"}, {Name: "role", Type: "s", Direction: "in"}, {Name: "protected", Type: "b", Direction: "in"}, {Name: "bounds", Type: "(iiii)", Direction: "in"}, {Name: "accepted", Type: "b", Direction: "out"},
}},
introspect.Method{Name: "GetRuntimeStateSnapshot", Args: []introspect.Arg{{Name: "snapshot", Type: "s", Direction: "out"}}},
introspect.Method{Name: "SpeakText", Args: []introspect.Arg{{Name: "text", Type: "s", Direction: "in"}, {Name: "interrupt", Type: "b", Direction: "in"}, {Name: "accepted", Type: "b", Direction: "out"}}},
introspect.Method{Name: "BrailleMessage", Args: []introspect.Arg{{Name: "text", Type: "s", Direction: "in"}, {Name: "accepted", Type: "b", Direction: "out"}}},
introspect.Method{Name: "CancelSpeech", Args: []introspect.Arg{{Name: "accepted", Type: "b", Direction: "out"}}},
introspect.Method{Name: "SpeakSsml", Args: []introspect.Arg{{Name: "requestId", Type: "s", Direction: "in"}, {Name: "ssml", Type: "s", Direction: "in"}, {Name: "result", Type: "i", Direction: "out"}}},
introspect.Method{Name: "PresentAccessibleEvent", Args: []introspect.Arg{
{Name: "sourceId", Type: "s", Direction: "in"}, {Name: "eventType", Type: "s", Direction: "in"},
{Name: "name", Type: "s", Direction: "in"}, {Name: "role", Type: "s", Direction: "in"},
{Name: "value", Type: "s", Direction: "in"}, {Name: "states", Type: "s", Direction: "in"},
{Name: "description", Type: "s", Direction: "in"}, {Name: "position", Type: "i", Direction: "in"},
{Name: "count", Type: "i", Direction: "in"}, {Name: "windowTitle", Type: "s", Direction: "in"},
{Name: "accepted", Type: "b", Direction: "out"},
}},
)
}