forked from sarim/goibus
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathengineDesc.go
68 lines (57 loc) · 2.36 KB
/
engineDesc.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
package goibus
import (
"github.com/godbus/dbus/v5"
)
type EngineDesc struct {
Name string `xml:"-"`
Attachments map[string]dbus.Variant `xml:"-"`
EngineName string `xml:"name"`
LongName string `xml:"longname"`
Description string `xml:"description"`
Language string `xml:"language"`
License string `xml:"license"`
Author string `xml:"author"`
Icon string `xml:"icon"`
Layout string `xml:"layout"`
Rank uint32 `xml:"rank"`
Hotkeys string `xml:"hotkeys,omitempty"`
Symbol string `xml:"symbol,omitempty"`
Setup string `xml:"setup,omitempty"`
LayoutVariant string `xml:"layout-variant,omitempty"`
LayoutOption string `xml:"layout-option,omitempty"`
Version string `xml:"version,omitempty"`
Textdomain string `xml:"textdomain,omitempty"`
}
func TinyEngineDesc(name string, longname string, desc string, lang string, license string, author string, icon string, layout string) *EngineDesc {
ed := &EngineDesc{}
ed.Name = "IBusEngineDesc"
ed.EngineName = name
ed.LongName = longname
ed.Description = desc
ed.Language = lang
ed.License = license
ed.Author = author
ed.Icon = icon
ed.Layout = layout
return ed
}
func SmallEngineDesc(name string, longname string, desc string, lang string, license string, author string, icon string, layout string,
setup string, version string) *EngineDesc {
ed := TinyEngineDesc(name, longname, desc, lang, license, author, icon, layout)
ed.Setup = setup
ed.Version = version
return ed
}
func FullEngineDesc(name string, longname string, desc string, lang string, license string, author string, icon string, layout string,
rank uint32, hotkeys string, symbol string, setup string, layoutVariant string, layoutOption string, version string, textdomain string) *EngineDesc {
ed := TinyEngineDesc(name, longname, desc, lang, license, author, icon, layout)
ed.Rank = rank
ed.Hotkeys = hotkeys
ed.Symbol = symbol
ed.Setup = setup
ed.LayoutVariant = layoutVariant
ed.LayoutOption = layoutOption
ed.Version = version
ed.Textdomain = textdomain
return ed
}