VT_Player/third_party/gotk3/gio/utils.go
Stu d4efa91ce1 Add vendored gotk3 GTK3 bindings for Go
Vendor gotk3 library to ensure consistent GTK3 bindings across
environments and simplify dependency management.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-15 05:40:43 -05:00

35 lines
564 B
Go

package gio
// #include <glib.h>
// #include "gresource.go.h"
import "C"
// same implementation as package glib
func toGoStringArray(c **C.char) []string {
var strs []string
originalc := c
defer C.char_g_strfreev(originalc)
for *c != nil {
strs = append(strs, C.GoString((*C.char)(*c)))
c = C.next_charptr(c)
}
return strs
}
func goString(cstr *C.gchar) string {
return C.GoString((*C.char)(cstr))
}
func gbool(b bool) C.gboolean {
if b {
return C.gboolean(1)
}
return C.gboolean(0)
}
func gobool(b C.gboolean) bool {
return b != C.FALSE
}