mirror of https://git.FreeBSD.org/ports.git
net-im/dissent: Fix build after libspelling update
Also remove go version after default go version was increased to 1.24. PR: 287656
This commit is contained in:
parent
dac482159a
commit
c5bf682a9c
|
@ -14,7 +14,7 @@ LICENSE_FILE= ${WRKSRC}/LICENSE.md
|
||||||
LIB_DEPENDS= libgraphene-1.0.so:graphics/graphene \
|
LIB_DEPENDS= libgraphene-1.0.so:graphics/graphene \
|
||||||
libspelling-1.so:x11-toolkits/libspelling
|
libspelling-1.so:x11-toolkits/libspelling
|
||||||
|
|
||||||
USES= gnome go:1.24,modules gstreamer pkgconfig
|
USES= gnome go:modules gstreamer pkgconfig
|
||||||
USE_GNOME= cairo gdkpixbuf gtk40 gtksourceview5 libadwaita
|
USE_GNOME= cairo gdkpixbuf gtk40 gtksourceview5 libadwaita
|
||||||
USE_GSTREAMER= bad good ugly
|
USE_GSTREAMER= bad good ugly
|
||||||
GO_MODULE= libdb.so/dissent
|
GO_MODULE= libdb.so/dissent
|
||||||
|
|
|
@ -1,681 +1,63 @@
|
||||||
Remove features that causing build error that our libspelling version doesn't have.
|
I guess that new libspelling version update caused this port to fail at build.
|
||||||
|
This patch seems to fix the issue by removing 'Dictionarier' code.
|
||||||
|
|
||||||
Reverted this commit:
|
# libdb.so/gotk4-spelling/pkg/spelling
|
||||||
https://github.com/diamondburned/gotk4-spelling/commit/a9edc40bddb0d3ae25dab085d0ae4d96097477ff
|
vendor/libdb.so/gotk4-spelling/pkg/spelling/spelling-provider.go:152:55: undefined: Dictionarier
|
||||||
|
vendor/libdb.so/gotk4-spelling/pkg/spelling/spelling-provider.go:165:18: undefined: Dictionarier
|
||||||
|
vendor/libdb.so/gotk4-spelling/pkg/spelling/spelling-provider.go:173:19: undefined: Dictionarier
|
||||||
|
vendor/libdb.so/gotk4-spelling/pkg/spelling/spelling-provider.go:176:22: undefined: Dictionarier
|
||||||
|
|
||||||
https://github.com/diamondburned/gotk4-spelling/issues/://github.com/diamondburned/gotk4-spelling/issues/1
|
--- vendor/libdb.so/gotk4-spelling/pkg/spelling/spelling-provider.go.orig 2025-06-19 16:55:15 UTC
|
||||||
|
|
||||||
--- vendor/libdb.so/gotk4-spelling/pkg/spelling/spelling-checker.go.orig 2025-01-24 19:56:09 UTC
|
|
||||||
+++ vendor/libdb.so/gotk4-spelling/pkg/spelling/spelling-checker.go
|
|
||||||
@@ -34,8 +34,6 @@ func defaultCheckerOverrides(v *Checker) CheckerOverri
|
|
||||||
return CheckerOverrides{}
|
|
||||||
}
|
|
||||||
|
|
||||||
-// Checker: SpellingChecker is the core class of libspelling. It provides
|
|
||||||
-// high-level APIs for spellchecking.
|
|
||||||
type Checker struct {
|
|
||||||
_ [0]func() // equal guard
|
|
||||||
*coreglib.Object
|
|
||||||
@@ -71,7 +69,7 @@ func marshalChecker(p uintptr) (interface{}, error) {
|
|
||||||
return wrapChecker(coreglib.ValueFromNative(unsafe.Pointer(p)).Object()), nil
|
|
||||||
}
|
|
||||||
|
|
||||||
-// NewChecker: create a new SpellingChecker.
|
|
||||||
+// NewChecker: create a new Checker.
|
|
||||||
//
|
|
||||||
// The function takes the following parameters:
|
|
||||||
//
|
|
||||||
@@ -80,7 +78,7 @@ func marshalChecker(p uintptr) (interface{}, error) {
|
|
||||||
//
|
|
||||||
// The function returns the following values:
|
|
||||||
//
|
|
||||||
-// - checker: newly created SpellingChecker.
|
|
||||||
+// - checker: newly created Checker.
|
|
||||||
func NewChecker(provider Providerer, language string) *Checker {
|
|
||||||
var _arg1 *C.SpellingProvider // out
|
|
||||||
var _arg2 *C.char // out
|
|
||||||
@@ -101,11 +99,6 @@ func NewChecker(provider Providerer, language string)
|
|
||||||
return _checker
|
|
||||||
}
|
|
||||||
|
|
||||||
-// AddWord adds word to the active dictionary.
|
|
||||||
-//
|
|
||||||
-// The function takes the following parameters:
|
|
||||||
-//
|
|
||||||
-// - word to be added.
|
|
||||||
func (self *Checker) AddWord(word string) {
|
|
||||||
var _arg0 *C.SpellingChecker // out
|
|
||||||
var _arg1 *C.char // out
|
|
||||||
@@ -119,15 +112,6 @@ func (self *Checker) AddWord(word string) {
|
|
||||||
runtime.KeepAlive(word)
|
|
||||||
}
|
|
||||||
|
|
||||||
-// CheckWord checks if the active dictionary contains word.
|
|
||||||
-//
|
|
||||||
-// The function takes the following parameters:
|
|
||||||
-//
|
|
||||||
-// - word to be checked.
|
|
||||||
-//
|
|
||||||
-// The function returns the following values:
|
|
||||||
-//
|
|
||||||
-// - ok: TRUE if the dictionary contains the word.
|
|
||||||
func (self *Checker) CheckWord(word string) bool {
|
|
||||||
var _arg0 *C.SpellingChecker // out
|
|
||||||
var _arg1 *C.char // out
|
|
||||||
@@ -153,11 +137,6 @@ func (self *Checker) CheckWord(word string) bool {
|
|
||||||
return _ok
|
|
||||||
}
|
|
||||||
|
|
||||||
-// ExtraWordChars gets the extra word characters of the active dictionary.
|
|
||||||
-//
|
|
||||||
-// The function returns the following values:
|
|
||||||
-//
|
|
||||||
-// - utf8: extra word characters.
|
|
||||||
func (self *Checker) ExtraWordChars() string {
|
|
||||||
var _arg0 *C.SpellingChecker // out
|
|
||||||
var _cret *C.char // in
|
|
||||||
@@ -203,7 +182,7 @@ func (self *Checker) Language() string {
|
|
||||||
//
|
|
||||||
// The function returns the following values:
|
|
||||||
//
|
|
||||||
-// - provider: SpellingProvider.
|
|
||||||
+// - provider: Provider.
|
|
||||||
func (self *Checker) Provider() Providerer {
|
|
||||||
var _arg0 *C.SpellingChecker // out
|
|
||||||
var _cret *C.SpellingProvider // in
|
|
||||||
@@ -236,11 +215,6 @@ func (self *Checker) Provider() Providerer {
|
|
||||||
return _provider
|
|
||||||
}
|
|
||||||
|
|
||||||
-// IgnoreWord requests the active dictionary to ignore word.
|
|
||||||
-//
|
|
||||||
-// The function takes the following parameters:
|
|
||||||
-//
|
|
||||||
-// - word to be ignored.
|
|
||||||
func (self *Checker) IgnoreWord(word string) {
|
|
||||||
var _arg0 *C.SpellingChecker // out
|
|
||||||
var _arg1 *C.char // out
|
|
||||||
@@ -318,12 +292,12 @@ func (self *Checker) SetLanguage(language string) {
|
|
||||||
runtime.KeepAlive(language)
|
|
||||||
}
|
|
||||||
|
|
||||||
-// CheckerGetDefault gets a default SpellingChecker using the default provider
|
|
||||||
-// and language.
|
|
||||||
+// CheckerGetDefault gets a default Checker using the default provider and
|
|
||||||
+// language.
|
|
||||||
//
|
|
||||||
// The function returns the following values:
|
|
||||||
//
|
|
||||||
-// - checker: SpellingChecker.
|
|
||||||
+// - checker: Checker.
|
|
||||||
func CheckerGetDefault() *Checker {
|
|
||||||
var _cret *C.SpellingChecker // in
|
|
||||||
|
|
||||||
--- vendor/libdb.so/gotk4-spelling/pkg/spelling/spelling-init.go.orig 2025-01-24 19:56:09 UTC
|
|
||||||
+++ vendor/libdb.so/gotk4-spelling/pkg/spelling/spelling-init.go
|
|
||||||
@@ -6,8 +6,6 @@ import "C"
|
|
||||||
// #include <libspelling.h>
|
|
||||||
import "C"
|
|
||||||
|
|
||||||
-// Init: call this function before using any other libspelling functions in your
|
|
||||||
-// applications. It will initialize everything needed to operate the library.
|
|
||||||
func Init() {
|
|
||||||
C.spelling_init()
|
|
||||||
}
|
|
||||||
--- vendor/libdb.so/gotk4-spelling/pkg/spelling/spelling-language.go.orig 2025-01-24 20:13:11 UTC
|
|
||||||
+++ vendor/libdb.so/gotk4-spelling/pkg/spelling/spelling-language.go
|
|
||||||
@@ -6,7 +6,6 @@ import (
|
|
||||||
"runtime"
|
|
||||||
"unsafe"
|
|
||||||
|
|
||||||
- "github.com/diamondburned/gotk4/pkg/core/gextras"
|
|
||||||
coreglib "github.com/diamondburned/gotk4/pkg/core/glib"
|
|
||||||
)
|
|
||||||
|
|
||||||
@@ -26,15 +25,6 @@ func init() {
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
-// LanguageOverrides contains methods that are overridable.
|
|
||||||
-type LanguageOverrides struct {
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
-func defaultLanguageOverrides(v *Language) LanguageOverrides {
|
|
||||||
- return LanguageOverrides{}
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
-// Language represents a spellchecking language.
|
|
||||||
type Language struct {
|
|
||||||
_ [0]func() // equal guard
|
|
||||||
*coreglib.Object
|
|
||||||
@@ -44,21 +34,16 @@ var (
|
|
||||||
_ coreglib.Objector = (*Language)(nil)
|
|
||||||
)
|
|
||||||
|
|
||||||
-func init() {
|
|
||||||
- coreglib.RegisterClassInfo[*Language, *LanguageClass, LanguageOverrides](
|
|
||||||
- GTypeLanguage,
|
|
||||||
- initLanguageClass,
|
|
||||||
- wrapLanguage,
|
|
||||||
- defaultLanguageOverrides,
|
|
||||||
- )
|
|
||||||
+// Languager describes types inherited from class Language.
|
|
||||||
+//
|
|
||||||
+// To get the original type, the caller must assert this to an interface or
|
|
||||||
+// another type.
|
|
||||||
+type Languager interface {
|
|
||||||
+ coreglib.Objector
|
|
||||||
+ baseLanguage() *Language
|
|
||||||
}
|
|
||||||
|
|
||||||
-func initLanguageClass(gclass unsafe.Pointer, overrides LanguageOverrides, classInitFunc func(*LanguageClass)) {
|
|
||||||
- if classInitFunc != nil {
|
|
||||||
- class := (*LanguageClass)(gextras.NewStructNative(gclass))
|
|
||||||
- classInitFunc(class)
|
|
||||||
- }
|
|
||||||
-}
|
|
||||||
+var _ Languager = (*Language)(nil)
|
|
||||||
|
|
||||||
func wrapLanguage(obj *coreglib.Object) *Language {
|
|
||||||
return &Language{
|
|
||||||
@@ -70,11 +55,53 @@ func marshalLanguage(p uintptr) (interface{}, error) {
|
|
||||||
return wrapLanguage(coreglib.ValueFromNative(unsafe.Pointer(p)).Object()), nil
|
|
||||||
}
|
|
||||||
|
|
||||||
-// Code gets the code of the language, or NULL if undefined.
|
|
||||||
-//
|
|
||||||
-// The function returns the following values:
|
|
||||||
-//
|
|
||||||
-// - utf8 (optional): code of the language.
|
|
||||||
+func (self *Language) baseLanguage() *Language {
|
|
||||||
+ return self
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+// BaseLanguage returns the underlying base object.
|
|
||||||
+func BaseLanguage(obj Languager) *Language {
|
|
||||||
+ return obj.baseLanguage()
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+func (self *Language) AddWord(word string) {
|
|
||||||
+ var _arg0 *C.SpellingLanguage // out
|
|
||||||
+ var _arg1 *C.char // out
|
|
||||||
+
|
|
||||||
+ _arg0 = (*C.SpellingLanguage)(unsafe.Pointer(coreglib.InternObject(self).Native()))
|
|
||||||
+ _arg1 = (*C.char)(unsafe.Pointer(C.CString(word)))
|
|
||||||
+ defer C.free(unsafe.Pointer(_arg1))
|
|
||||||
+
|
|
||||||
+ C.spelling_language_add_word(_arg0, _arg1)
|
|
||||||
+ runtime.KeepAlive(self)
|
|
||||||
+ runtime.KeepAlive(word)
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+func (self *Language) ContainsWord(word string) bool {
|
|
||||||
+ var _arg0 *C.SpellingLanguage // out
|
|
||||||
+ var _arg1 *C.char // out
|
|
||||||
+ var _arg2 C.gssize
|
|
||||||
+ var _cret C.gboolean // in
|
|
||||||
+
|
|
||||||
+ _arg0 = (*C.SpellingLanguage)(unsafe.Pointer(coreglib.InternObject(self).Native()))
|
|
||||||
+ _arg2 = (C.gssize)(len(word))
|
|
||||||
+ _arg1 = (*C.char)(C.calloc(C.size_t((len(word) + 1)), C.size_t(C.sizeof_char)))
|
|
||||||
+ copy(unsafe.Slice((*byte)(unsafe.Pointer(_arg1)), len(word)), word)
|
|
||||||
+ defer C.free(unsafe.Pointer(_arg1))
|
|
||||||
+
|
|
||||||
+ _cret = C.spelling_language_contains_word(_arg0, _arg1, _arg2)
|
|
||||||
+ runtime.KeepAlive(self)
|
|
||||||
+ runtime.KeepAlive(word)
|
|
||||||
+
|
|
||||||
+ var _ok bool // out
|
|
||||||
+
|
|
||||||
+ if _cret != 0 {
|
|
||||||
+ _ok = true
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ return _ok
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
func (self *Language) Code() string {
|
|
||||||
var _arg0 *C.SpellingLanguage // out
|
|
||||||
var _cret *C.char // in
|
|
||||||
@@ -86,65 +113,84 @@ func (self *Language) Code() string {
|
|
||||||
|
|
||||||
var _utf8 string // out
|
|
||||||
|
|
||||||
- if _cret != nil {
|
|
||||||
- _utf8 = C.GoString((*C.gchar)(unsafe.Pointer(_cret)))
|
|
||||||
- }
|
|
||||||
+ _utf8 = C.GoString((*C.gchar)(unsafe.Pointer(_cret)))
|
|
||||||
|
|
||||||
return _utf8
|
|
||||||
}
|
|
||||||
|
|
||||||
-// Group gets the group of the language, or NULL if undefined.
|
|
||||||
-//
|
|
||||||
-// The function returns the following values:
|
|
||||||
-//
|
|
||||||
-// - utf8 (optional): group of the language.
|
|
||||||
-func (self *Language) Group() string {
|
|
||||||
+func (self *Language) ExtraWordChars() string {
|
|
||||||
var _arg0 *C.SpellingLanguage // out
|
|
||||||
var _cret *C.char // in
|
|
||||||
|
|
||||||
_arg0 = (*C.SpellingLanguage)(unsafe.Pointer(coreglib.InternObject(self).Native()))
|
|
||||||
|
|
||||||
- _cret = C.spelling_language_get_group(_arg0)
|
|
||||||
+ _cret = C.spelling_language_get_extra_word_chars(_arg0)
|
|
||||||
runtime.KeepAlive(self)
|
|
||||||
|
|
||||||
var _utf8 string // out
|
|
||||||
|
|
||||||
- if _cret != nil {
|
|
||||||
- _utf8 = C.GoString((*C.gchar)(unsafe.Pointer(_cret)))
|
|
||||||
- }
|
|
||||||
+ _utf8 = C.GoString((*C.gchar)(unsafe.Pointer(_cret)))
|
|
||||||
|
|
||||||
return _utf8
|
|
||||||
}
|
|
||||||
|
|
||||||
-// Name gets the name of the language, or NULL if undefined.
|
|
||||||
+func (self *Language) IgnoreWord(word string) {
|
|
||||||
+ var _arg0 *C.SpellingLanguage // out
|
|
||||||
+ var _arg1 *C.char // out
|
|
||||||
+
|
|
||||||
+ _arg0 = (*C.SpellingLanguage)(unsafe.Pointer(coreglib.InternObject(self).Native()))
|
|
||||||
+ _arg1 = (*C.char)(unsafe.Pointer(C.CString(word)))
|
|
||||||
+ defer C.free(unsafe.Pointer(_arg1))
|
|
||||||
+
|
|
||||||
+ C.spelling_language_ignore_word(_arg0, _arg1)
|
|
||||||
+ runtime.KeepAlive(self)
|
|
||||||
+ runtime.KeepAlive(word)
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+// ListCorrections retrieves a list of possible corrections for word.
|
|
||||||
//
|
|
||||||
+// The function takes the following parameters:
|
|
||||||
+//
|
|
||||||
+// - word to be checked.
|
|
||||||
+//
|
|
||||||
// The function returns the following values:
|
|
||||||
//
|
|
||||||
-// - utf8 (optional): name of the language.
|
|
||||||
-func (self *Language) Name() string {
|
|
||||||
+// - utf8s (optional): A list of possible corrections, or NULL.
|
|
||||||
+func (self *Language) ListCorrections(word string) []string {
|
|
||||||
var _arg0 *C.SpellingLanguage // out
|
|
||||||
- var _cret *C.char // in
|
|
||||||
+ var _arg1 *C.char // out
|
|
||||||
+ var _arg2 C.gssize
|
|
||||||
+ var _cret **C.char // in
|
|
||||||
|
|
||||||
_arg0 = (*C.SpellingLanguage)(unsafe.Pointer(coreglib.InternObject(self).Native()))
|
|
||||||
+ _arg2 = (C.gssize)(len(word))
|
|
||||||
+ _arg1 = (*C.char)(C.calloc(C.size_t((len(word) + 1)), C.size_t(C.sizeof_char)))
|
|
||||||
+ copy(unsafe.Slice((*byte)(unsafe.Pointer(_arg1)), len(word)), word)
|
|
||||||
+ defer C.free(unsafe.Pointer(_arg1))
|
|
||||||
|
|
||||||
- _cret = C.spelling_language_get_name(_arg0)
|
|
||||||
+ _cret = C.spelling_language_list_corrections(_arg0, _arg1, _arg2)
|
|
||||||
runtime.KeepAlive(self)
|
|
||||||
+ runtime.KeepAlive(word)
|
|
||||||
|
|
||||||
- var _utf8 string // out
|
|
||||||
+ var _utf8s []string // out
|
|
||||||
|
|
||||||
if _cret != nil {
|
|
||||||
- _utf8 = C.GoString((*C.gchar)(unsafe.Pointer(_cret)))
|
|
||||||
+ defer C.free(unsafe.Pointer(_cret))
|
|
||||||
+ {
|
|
||||||
+ var i int
|
|
||||||
+ var z *C.char
|
|
||||||
+ for p := _cret; *p != z; p = &unsafe.Slice(p, 2)[1] {
|
|
||||||
+ i++
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ src := unsafe.Slice(_cret, i)
|
|
||||||
+ _utf8s = make([]string, i)
|
|
||||||
+ for i := range src {
|
|
||||||
+ _utf8s[i] = C.GoString((*C.gchar)(unsafe.Pointer(src[i])))
|
|
||||||
+ defer C.free(unsafe.Pointer(src[i]))
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
}
|
|
||||||
|
|
||||||
- return _utf8
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
-// LanguageClass: instance of this type is always passed by reference.
|
|
||||||
-type LanguageClass struct {
|
|
||||||
- *languageClass
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
-// languageClass is the struct that's finalized.
|
|
||||||
-type languageClass struct {
|
|
||||||
- native *C.SpellingLanguageClass
|
|
||||||
+ return _utf8s
|
|
||||||
}
|
|
||||||
--- vendor/libdb.so/gotk4-spelling/pkg/spelling/spelling-provider.go.orig 2025-01-24 20:13:11 UTC
|
|
||||||
+++ vendor/libdb.so/gotk4-spelling/pkg/spelling/spelling-provider.go
|
+++ vendor/libdb.so/gotk4-spelling/pkg/spelling/spelling-provider.go
|
||||||
@@ -7,7 +7,6 @@ import (
|
@@ -139,51 +139,6 @@ func (self *Provider) ListLanguages() *gio.ListModel {
|
||||||
"unsafe"
|
return _listModel
|
||||||
|
|
||||||
coreglib "github.com/diamondburned/gotk4/pkg/core/glib"
|
|
||||||
- "github.com/diamondburned/gotk4/pkg/gio/v2"
|
|
||||||
)
|
|
||||||
|
|
||||||
// #include <stdlib.h>
|
|
||||||
@@ -26,7 +25,6 @@ func init() {
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
-// Provider: abstract base class for spellchecking providers.
|
|
||||||
type Provider struct {
|
|
||||||
_ [0]func() // equal guard
|
|
||||||
*coreglib.Object
|
|
||||||
@@ -66,12 +64,6 @@ func BaseProvider(obj Providerer) *Provider {
|
|
||||||
return obj.baseProvider()
|
|
||||||
}
|
|
||||||
|
|
||||||
-// DefaultCode gets the default language code for the detected system locales,
|
|
||||||
-// or NULL if the provider doesn't support any of them.
|
|
||||||
-//
|
|
||||||
-// The function returns the following values:
|
|
||||||
-//
|
|
||||||
-// - utf8 (optional): default language code.
|
|
||||||
func (self *Provider) DefaultCode() string {
|
|
||||||
var _arg0 *C.SpellingProvider // out
|
|
||||||
var _cret *C.char // in
|
|
||||||
@@ -83,18 +75,11 @@ func (self *Provider) DefaultCode() string {
|
|
||||||
|
|
||||||
var _utf8 string // out
|
|
||||||
|
|
||||||
- if _cret != nil {
|
|
||||||
- _utf8 = C.GoString((*C.gchar)(unsafe.Pointer(_cret)))
|
|
||||||
- }
|
|
||||||
+ _utf8 = C.GoString((*C.gchar)(unsafe.Pointer(_cret)))
|
|
||||||
|
|
||||||
return _utf8
|
|
||||||
}
|
|
||||||
|
|
||||||
-// DisplayName gets the display name of the provider, or NULL if undefined.
|
|
||||||
-//
|
|
||||||
-// The function returns the following values:
|
|
||||||
-//
|
|
||||||
-// - utf8 (optional): display name of the provider.
|
|
||||||
func (self *Provider) DisplayName() string {
|
|
||||||
var _arg0 *C.SpellingProvider // out
|
|
||||||
var _cret *C.char // in
|
|
||||||
@@ -106,63 +91,35 @@ func (self *Provider) DisplayName() string {
|
|
||||||
|
|
||||||
var _utf8 string // out
|
|
||||||
|
|
||||||
- if _cret != nil {
|
|
||||||
- _utf8 = C.GoString((*C.gchar)(unsafe.Pointer(_cret)))
|
|
||||||
- }
|
|
||||||
+ _utf8 = C.GoString((*C.gchar)(unsafe.Pointer(_cret)))
|
|
||||||
|
|
||||||
return _utf8
|
|
||||||
}
|
|
||||||
|
|
||||||
-// ListLanguages gets a GListModel of languages supported by the provider.
|
|
||||||
+// Language gets an Language for the requested language, or NULL if the language
|
|
||||||
+// is not supported.
|
|
||||||
//
|
|
||||||
-// The function returns the following values:
|
|
||||||
-//
|
|
||||||
-// - listModel: GListModel of SpellingLanguage.
|
|
||||||
-func (self *Provider) ListLanguages() *gio.ListModel {
|
|
||||||
- var _arg0 *C.SpellingProvider // out
|
|
||||||
- var _cret *C.GListModel // in
|
|
||||||
-
|
|
||||||
- _arg0 = (*C.SpellingProvider)(unsafe.Pointer(coreglib.InternObject(self).Native()))
|
|
||||||
-
|
|
||||||
- _cret = C.spelling_provider_list_languages(_arg0)
|
|
||||||
- runtime.KeepAlive(self)
|
|
||||||
-
|
|
||||||
- var _listModel *gio.ListModel // out
|
|
||||||
-
|
|
||||||
- {
|
|
||||||
- obj := coreglib.AssumeOwnership(unsafe.Pointer(_cret))
|
|
||||||
- _listModel = &gio.ListModel{
|
|
||||||
- Object: obj,
|
|
||||||
- }
|
|
||||||
- }
|
|
||||||
-
|
|
||||||
- return _listModel
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
-// LoadDictionary gets a SpellingDictionary for the requested language, or NULL
|
-// LoadDictionary gets a SpellingDictionary for the requested language, or NULL
|
||||||
-// if the language is not supported.
|
-// if the language is not supported.
|
||||||
-//
|
-//
|
||||||
// The function takes the following parameters:
|
-// The function takes the following parameters:
|
||||||
//
|
-//
|
||||||
// - language to load such as en_US.
|
-// - language to load such as en_US.
|
||||||
//
|
-//
|
||||||
// The function returns the following values:
|
-// The function returns the following values:
|
||||||
//
|
-//
|
||||||
-// - dictionary (optional): SpellingDictionary or NULL.
|
-// - dictionary (optional): SpellingDictionary or NULL.
|
||||||
-func (self *Provider) LoadDictionary(language string) Dictionarier {
|
-func (self *Provider) LoadDictionary(language string) Dictionarier {
|
||||||
- var _arg0 *C.SpellingProvider // out
|
- var _arg0 *C.SpellingProvider // out
|
||||||
- var _arg1 *C.char // out
|
- var _arg1 *C.char // out
|
||||||
- var _cret *C.SpellingDictionary // in
|
- var _cret *C.SpellingDictionary // in
|
||||||
+// - ret (optional) or NULL.
|
-
|
||||||
+func (self *Provider) Language(language string) Languager {
|
- _arg0 = (*C.SpellingProvider)(unsafe.Pointer(coreglib.InternObject(self).Native()))
|
||||||
+ var _arg0 *C.SpellingProvider // out
|
- _arg1 = (*C.char)(unsafe.Pointer(C.CString(language)))
|
||||||
+ var _arg1 *C.char // out
|
- defer C.free(unsafe.Pointer(_arg1))
|
||||||
+ var _cret *C.SpellingLanguage // in
|
-
|
||||||
|
|
||||||
_arg0 = (*C.SpellingProvider)(unsafe.Pointer(coreglib.InternObject(self).Native()))
|
|
||||||
_arg1 = (*C.char)(unsafe.Pointer(C.CString(language)))
|
|
||||||
defer C.free(unsafe.Pointer(_arg1))
|
|
||||||
|
|
||||||
- _cret = C.spelling_provider_load_dictionary(_arg0, _arg1)
|
- _cret = C.spelling_provider_load_dictionary(_arg0, _arg1)
|
||||||
+ _cret = C.spelling_provider_get_language(_arg0, _arg1)
|
- runtime.KeepAlive(self)
|
||||||
runtime.KeepAlive(self)
|
- runtime.KeepAlive(language)
|
||||||
runtime.KeepAlive(language)
|
-
|
||||||
|
|
||||||
- var _dictionary Dictionarier // out
|
- var _dictionary Dictionarier // out
|
||||||
+ var _ret Languager // out
|
-
|
||||||
|
|
||||||
if _cret != nil {
|
|
||||||
{
|
|
||||||
@@ -170,18 +127,18 @@ func (self *Provider) LoadDictionary(language string)
|
|
||||||
|
|
||||||
object := coreglib.AssumeOwnership(objptr)
|
|
||||||
casted := object.WalkCast(func(obj coreglib.Objector) bool {
|
|
||||||
- _, ok := obj.(Dictionarier)
|
|
||||||
+ _, ok := obj.(Languager)
|
|
||||||
return ok
|
|
||||||
})
|
|
||||||
- rv, ok := casted.(Dictionarier)
|
|
||||||
+ rv, ok := casted.(Languager)
|
|
||||||
if !ok {
|
|
||||||
- panic("no marshaler for " + object.TypeFromInstance().String() + " matching spelling.Dictionarier")
|
|
||||||
+ panic("no marshaler for " + object.TypeFromInstance().String() + " matching spelling.Languager")
|
|
||||||
}
|
|
||||||
- _dictionary = rv
|
|
||||||
+ _ret = rv
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
- return _dictionary
|
|
||||||
+ return _ret
|
|
||||||
}
|
|
||||||
|
|
||||||
// SupportsLanguage checks of language is supported by the provider.
|
|
||||||
@@ -219,7 +176,7 @@ func (self *Provider) SupportsLanguage(language string
|
|
||||||
//
|
|
||||||
// The function returns the following values:
|
|
||||||
//
|
|
||||||
-// - provider: SpellingProvider.
|
|
||||||
+// - provider: Provider.
|
|
||||||
func ProviderGetDefault() Providerer {
|
|
||||||
var _cret *C.SpellingProvider // in
|
|
||||||
|
|
||||||
--- vendor/libdb.so/gotk4-spelling/pkg/spelling/spelling-text-buffer-adapter.go.orig 2025-01-24 20:13:11 UTC
|
|
||||||
+++ vendor/libdb.so/gotk4-spelling/pkg/spelling/spelling-text-buffer-adapter.go
|
|
||||||
@@ -37,8 +37,6 @@ func defaultTextBufferAdapterOverrides(v *TextBufferAd
|
|
||||||
return TextBufferAdapterOverrides{}
|
|
||||||
}
|
|
||||||
|
|
||||||
-// TextBufferAdapter: SpellingTextBufferAdapter implements helpers to easily add
|
|
||||||
-// spellchecking capabilities to a GtkSourceBuffer.
|
|
||||||
type TextBufferAdapter struct {
|
|
||||||
_ [0]func() // equal guard
|
|
||||||
*coreglib.Object
|
|
||||||
@@ -79,16 +77,10 @@ func marshalTextBufferAdapter(p uintptr) (interface{},
|
|
||||||
return wrapTextBufferAdapter(coreglib.ValueFromNative(unsafe.Pointer(p)).Object()), nil
|
|
||||||
}
|
|
||||||
|
|
||||||
-// NewTextBufferAdapter: create a new SpellingTextBufferAdapter.
|
|
||||||
-//
|
|
||||||
// The function takes the following parameters:
|
|
||||||
//
|
|
||||||
-// - buffer: GtkSourceBuffer.
|
|
||||||
-// - checker: SpellingChecker.
|
|
||||||
-//
|
|
||||||
-// The function returns the following values:
|
|
||||||
-//
|
|
||||||
-// - textBufferAdapter: newly created SpellingTextBufferAdapter.
|
|
||||||
+// - buffer
|
|
||||||
+// - checker
|
|
||||||
func NewTextBufferAdapter(buffer *gtksource.Buffer, checker *Checker) *TextBufferAdapter {
|
|
||||||
var _arg1 *C.GtkSourceBuffer // out
|
|
||||||
var _arg2 *C.SpellingChecker // out
|
|
||||||
@@ -112,7 +104,7 @@ func NewTextBufferAdapter(buffer *gtksource.Buffer, ch
|
|
||||||
//
|
|
||||||
// The function returns the following values:
|
|
||||||
//
|
|
||||||
-// - buffer (optional): GtkSourceBuffer.
|
|
||||||
+// - buffer (optional): SourceBuffer.
|
|
||||||
func (self *TextBufferAdapter) Buffer() *gtksource.Buffer {
|
|
||||||
var _arg0 *C.SpellingTextBufferAdapter // out
|
|
||||||
var _cret *C.GtkSourceBuffer // in
|
|
||||||
@@ -142,7 +134,7 @@ func (self *TextBufferAdapter) Buffer() *gtksource.Buf
|
|
||||||
//
|
|
||||||
// The function returns the following values:
|
|
||||||
//
|
|
||||||
-// - checker (optional): SpellingChecker or NULL.
|
|
||||||
+// - checker (optional) or NULL.
|
|
||||||
func (self *TextBufferAdapter) Checker() *Checker {
|
|
||||||
var _arg0 *C.SpellingTextBufferAdapter // out
|
|
||||||
var _cret *C.SpellingChecker // in
|
|
||||||
@@ -161,11 +153,6 @@ func (self *TextBufferAdapter) Checker() *Checker {
|
|
||||||
return _checker
|
|
||||||
}
|
|
||||||
|
|
||||||
-// Enabled gets if the spellcheck is enabled.
|
|
||||||
-//
|
|
||||||
-// The function returns the following values:
|
|
||||||
-//
|
|
||||||
-// - ok: TRUE if enabled.
|
|
||||||
func (self *TextBufferAdapter) Enabled() bool {
|
|
||||||
var _arg0 *C.SpellingTextBufferAdapter // out
|
|
||||||
var _cret C.gboolean // in
|
|
||||||
@@ -184,11 +171,6 @@ func (self *TextBufferAdapter) Enabled() bool {
|
|
||||||
return _ok
|
|
||||||
}
|
|
||||||
|
|
||||||
-// Language gets the checker language.
|
|
||||||
-//
|
|
||||||
-// The function returns the following values:
|
|
||||||
-//
|
|
||||||
-// - utf8 (optional): language code.
|
|
||||||
func (self *TextBufferAdapter) Language() string {
|
|
||||||
var _arg0 *C.SpellingTextBufferAdapter // out
|
|
||||||
var _cret *C.char // in
|
|
||||||
@@ -200,9 +182,7 @@ func (self *TextBufferAdapter) Language() string {
|
|
||||||
|
|
||||||
var _utf8 string // out
|
|
||||||
|
|
||||||
- if _cret != nil {
|
- if _cret != nil {
|
||||||
- _utf8 = C.GoString((*C.gchar)(unsafe.Pointer(_cret)))
|
- {
|
||||||
|
- objptr := unsafe.Pointer(_cret)
|
||||||
|
-
|
||||||
|
- object := coreglib.AssumeOwnership(objptr)
|
||||||
|
- casted := object.WalkCast(func(obj coreglib.Objector) bool {
|
||||||
|
- _, ok := obj.(Dictionarier)
|
||||||
|
- return ok
|
||||||
|
- })
|
||||||
|
- rv, ok := casted.(Dictionarier)
|
||||||
|
- if !ok {
|
||||||
|
- panic("no marshaler for " + object.TypeFromInstance().String() + " matching spelling.Dictionarier")
|
||||||
|
- }
|
||||||
|
- _dictionary = rv
|
||||||
|
- }
|
||||||
- }
|
- }
|
||||||
+ _utf8 = C.GoString((*C.gchar)(unsafe.Pointer(_cret)))
|
-
|
||||||
|
- return _dictionary
|
||||||
return _utf8
|
|
||||||
}
|
|
||||||
@@ -211,7 +191,7 @@ func (self *TextBufferAdapter) Language() string {
|
|
||||||
//
|
|
||||||
// The function returns the following values:
|
|
||||||
//
|
|
||||||
-// - menuModel: GMenuModel.
|
|
||||||
+// - menuModel: Model.
|
|
||||||
func (self *TextBufferAdapter) MenuModel() gio.MenuModeller {
|
|
||||||
var _arg0 *C.SpellingTextBufferAdapter // out
|
|
||||||
var _cret *C.GMenuModel // in
|
|
||||||
@@ -248,7 +228,7 @@ func (self *TextBufferAdapter) MenuModel() gio.MenuMod
|
|
||||||
//
|
|
||||||
// The function returns the following values:
|
|
||||||
//
|
|
||||||
-// - textTag (optional): GtkTextTag or NULL.
|
|
||||||
+// - textTag (optional) or NULL.
|
|
||||||
func (self *TextBufferAdapter) Tag() *gtk.TextTag {
|
|
||||||
var _arg0 *C.SpellingTextBufferAdapter // out
|
|
||||||
var _cret *C.GtkTextTag // in
|
|
||||||
@@ -272,9 +252,6 @@ func (self *TextBufferAdapter) Tag() *gtk.TextTag {
|
|
||||||
return _textTag
|
|
||||||
}
|
|
||||||
|
|
||||||
-// InvalidateAll: invalidate the spelling engine, to force parsing again.
|
|
||||||
-//
|
|
||||||
-// Invalidation is automatically done on gtksource.Buffer:loading change.
|
|
||||||
func (self *TextBufferAdapter) InvalidateAll() {
|
|
||||||
var _arg0 *C.SpellingTextBufferAdapter // out
|
|
||||||
|
|
||||||
@@ -284,11 +261,6 @@ func (self *TextBufferAdapter) InvalidateAll() {
|
|
||||||
runtime.KeepAlive(self)
|
|
||||||
}
|
|
||||||
|
|
||||||
-// SetChecker: set the spelling.Checker used for spellchecking.
|
|
||||||
-//
|
|
||||||
-// The function takes the following parameters:
|
|
||||||
-//
|
|
||||||
-// - checker: SpellingChecker.
|
|
||||||
func (self *TextBufferAdapter) SetChecker(checker *Checker) {
|
|
||||||
var _arg0 *C.SpellingTextBufferAdapter // out
|
|
||||||
var _arg1 *C.SpellingChecker // out
|
|
||||||
@@ -301,11 +273,6 @@ func (self *TextBufferAdapter) SetChecker(checker *Che
|
|
||||||
runtime.KeepAlive(checker)
|
|
||||||
}
|
|
||||||
|
|
||||||
-// SetEnabled: if TRUE spellcheck is enabled.
|
|
||||||
-//
|
|
||||||
-// The function takes the following parameters:
|
|
||||||
-//
|
|
||||||
-// - enabled: whether the spellcheck is enabled.
|
|
||||||
func (self *TextBufferAdapter) SetEnabled(enabled bool) {
|
|
||||||
var _arg0 *C.SpellingTextBufferAdapter // out
|
|
||||||
var _arg1 C.gboolean // out
|
|
||||||
@@ -320,11 +287,6 @@ func (self *TextBufferAdapter) SetEnabled(enabled bool
|
|
||||||
runtime.KeepAlive(enabled)
|
|
||||||
}
|
|
||||||
|
|
||||||
-// SetLanguage sets the language code to use by the checker, such as en_US.
|
|
||||||
-//
|
|
||||||
-// The function takes the following parameters:
|
|
||||||
-//
|
|
||||||
-// - language to use.
|
|
||||||
func (self *TextBufferAdapter) SetLanguage(language string) {
|
|
||||||
var _arg0 *C.SpellingTextBufferAdapter // out
|
|
||||||
var _arg1 *C.char // out
|
|
||||||
@@ -336,20 +298,6 @@ func (self *TextBufferAdapter) SetLanguage(language st
|
|
||||||
C.spelling_text_buffer_adapter_set_language(_arg0, _arg1)
|
|
||||||
runtime.KeepAlive(self)
|
|
||||||
runtime.KeepAlive(language)
|
|
||||||
-}
|
-}
|
||||||
-
|
-
|
||||||
-// UpdateCorrections looks at the current cursor position and updates the list
|
// SupportsLanguage checks of language is supported by the provider.
|
||||||
-// of corrections based on the current word.
|
//
|
||||||
-//
|
// The function takes the following parameters:
|
||||||
-// Use this to force an update immediately rather than after the automatic
|
|
||||||
-// timeout caused by cursor movements.
|
|
||||||
-func (self *TextBufferAdapter) UpdateCorrections() {
|
|
||||||
- var _arg0 *C.SpellingTextBufferAdapter // out
|
|
||||||
-
|
|
||||||
- _arg0 = (*C.SpellingTextBufferAdapter)(unsafe.Pointer(coreglib.InternObject(self).Native()))
|
|
||||||
-
|
|
||||||
- C.spelling_text_buffer_adapter_update_corrections(_arg0)
|
|
||||||
- runtime.KeepAlive(self)
|
|
||||||
}
|
|
||||||
|
|
||||||
// TextBufferAdapterClass: instance of this type is always passed by reference.
|
|
||||||
|
|
Loading…
Reference in New Issue