VideoTools/third_party/gotk3/glib/gvariantiter.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

53 lines
1.2 KiB
Go

// Same copyright and license as the rest of the files in this project
//GVariant : GVariant — strongly typed value datatype
// https://developer.gnome.org/glib/2.26/glib-GVariant.html
package glib
// #include <glib.h>
// #include <glib-object.h>
// #include "glib.go.h"
// #include "gvariant.go.h"
import "C"
import "unsafe"
/*
* GVariantIter
*/
// VariantIter is a representation of GLib's GVariantIter.
type VariantIter struct {
GVariantIter *C.GVariantIter
}
func (v *VariantIter) toGVariantIter() *C.GVariantIter {
if v == nil {
return nil
}
return v.native()
}
func (v *VariantIter) toVariantIter() *VariantIter {
return v
}
// newVariantIter creates a new VariantIter from a GVariantIter pointer.
func newVariantIter(p *C.GVariantIter) *VariantIter {
return &VariantIter{GVariantIter: p}
}
// native returns a pointer to the underlying GVariantIter.
func (v *VariantIter) native() *C.GVariantIter {
if v == nil || v.GVariantIter == nil {
return nil
}
p := unsafe.Pointer(v.GVariantIter)
return C.toGVariantIter(p)
}
// Native returns a pointer to the underlying GVariantIter.
func (v *VariantIter) Native() uintptr {
return uintptr(unsafe.Pointer(v.native()))
}