forked from Leak_Technologies/VideoTools
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>
32 lines
582 B
Go
32 lines
582 B
Go
package glib
|
|
|
|
// #include <gio/gio.h>
|
|
// #include <glib.h>
|
|
// #include <glib-object.h>
|
|
// #include "glib.go.h"
|
|
import "C"
|
|
|
|
type Source C.GSource
|
|
|
|
// native returns a pointer to the underlying GSource.
|
|
func (v *Source) native() *C.GSource {
|
|
if v == nil {
|
|
return nil
|
|
}
|
|
return (*C.GSource)(v)
|
|
}
|
|
|
|
func wrapSource(sourcePtr *C.GSource) *Source {
|
|
source := Source(*sourcePtr)
|
|
return &source
|
|
}
|
|
|
|
// MainCurrentSource is a wrapper around g_main_current_source().
|
|
func MainCurrentSource() *Source {
|
|
c := C.g_main_current_source()
|
|
if c == nil {
|
|
return nil
|
|
}
|
|
return (*Source)(c)
|
|
}
|