// Package gobject was automatically generated by github.com/bnema/puregotk DO NOT EDIT package gobject import ( "structs" "unsafe" "github.com/ebitengine/purego" "github.com/bnema/puregotk/pkg/core" "github.com/bnema/puregotk/v4/gobject/types" ) // The class of an enumeration type holds information about its // possible values. type EnumClass struct { _ structs.HostLayout GTypeClass uintptr Minimum int32 Maximum int32 NValues uint Values *EnumValue } func (x *EnumClass) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } // A structure which contains a single enum value, its name, and its // nickname. type EnumValue struct { _ structs.HostLayout Value int32 ValueName uintptr ValueNick uintptr } func (x *EnumValue) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } // The class of a flags type holds information about its // possible values. type FlagsClass struct { _ structs.HostLayout GTypeClass uintptr Mask uint NValues uint Values *FlagsValue } func (x *FlagsClass) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } // A structure which contains a single flags value, its name, and its // nickname. type FlagsValue struct { _ structs.HostLayout Value uint ValueName uintptr ValueNick uintptr } func (x *FlagsValue) GoPointer() uintptr { return uintptr(unsafe.Pointer(x)) } var xEnumCompleteTypeInfo func(types.GType, *TypeInfo, []EnumValue) // This function is meant to be called from the `complete_type_info` // function of a #GTypePlugin implementation, as in the following // example: // // |[<!-- language="C" --> // static void // my_enum_complete_type_info (GTypePlugin *plugin, // // GType g_type, // GTypeInfo *info, // GTypeValueTable *value_table) // // { // static const GEnumValue values[] = { // { MY_ENUM_FOO, "MY_ENUM_FOO", "foo" }, // { MY_ENUM_BAR, "MY_ENUM_BAR", "bar" }, // { 0, NULL, NULL } // }; // // g_enum_complete_type_info (type, info, values); // } // // ]| func EnumCompleteTypeInfo(GEnumTypeVar types.GType, InfoVar *TypeInfo, ConstValuesVar []EnumValue) { xEnumCompleteTypeInfo(GEnumTypeVar, InfoVar, ConstValuesVar) } var xEnumGetValue func(*EnumClass, int) *EnumValue // Returns the #GEnumValue for a value. func EnumGetValue(EnumClassVar *EnumClass, ValueVar int) *EnumValue { cret := xEnumGetValue(EnumClassVar, ValueVar) return cret } var xEnumGetValueByName func(*EnumClass, string) *EnumValue // Looks up a #GEnumValue by name. func EnumGetValueByName(EnumClassVar *EnumClass, NameVar string) *EnumValue { cret := xEnumGetValueByName(EnumClassVar, NameVar) return cret } var xEnumGetValueByNick func(*EnumClass, string) *EnumValue // Looks up a #GEnumValue by nickname. func EnumGetValueByNick(EnumClassVar *EnumClass, NickVar string) *EnumValue { cret := xEnumGetValueByNick(EnumClassVar, NickVar) return cret } var xEnumRegisterStatic func(string, []EnumValue) types.GType // Registers a new static enumeration type with the name @name. // // It is normally more convenient to let [glib-mkenums][glib-mkenums], // generate a my_enum_get_type() function from a usual C enumeration // definition than to write one yourself using g_enum_register_static(). func EnumRegisterStatic(NameVar string, ConstStaticValuesVar []EnumValue) types.GType { cret := xEnumRegisterStatic(NameVar, ConstStaticValuesVar) return cret } var xEnumToString func(types.GType, int) string // Pretty-prints @value in the form of the enum’s name. // // This is intended to be used for debugging purposes. The format of the output // may change in the future. func EnumToString(GEnumTypeVar types.GType, ValueVar int) string { cret := xEnumToString(GEnumTypeVar, ValueVar) return cret } var xFlagsCompleteTypeInfo func(types.GType, *TypeInfo, []FlagsValue) // This function is meant to be called from the complete_type_info() // function of a #GTypePlugin implementation, see the example for // g_enum_complete_type_info() above. func FlagsCompleteTypeInfo(GFlagsTypeVar types.GType, InfoVar *TypeInfo, ConstValuesVar []FlagsValue) { xFlagsCompleteTypeInfo(GFlagsTypeVar, InfoVar, ConstValuesVar) } var xFlagsGetFirstValue func(*FlagsClass, uint) *FlagsValue // Returns the first #GFlagsValue which is set in @value. func FlagsGetFirstValue(FlagsClassVar *FlagsClass, ValueVar uint) *FlagsValue { cret := xFlagsGetFirstValue(FlagsClassVar, ValueVar) return cret } var xFlagsGetValueByName func(*FlagsClass, string) *FlagsValue // Looks up a #GFlagsValue by name. func FlagsGetValueByName(FlagsClassVar *FlagsClass, NameVar string) *FlagsValue { cret := xFlagsGetValueByName(FlagsClassVar, NameVar) return cret } var xFlagsGetValueByNick func(*FlagsClass, string) *FlagsValue // Looks up a #GFlagsValue by nickname. func FlagsGetValueByNick(FlagsClassVar *FlagsClass, NickVar string) *FlagsValue { cret := xFlagsGetValueByNick(FlagsClassVar, NickVar) return cret } var xFlagsRegisterStatic func(string, []FlagsValue) types.GType // Registers a new static flags type with the name @name. // // It is normally more convenient to let [glib-mkenums][glib-mkenums] // generate a my_flags_get_type() function from a usual C enumeration // definition than to write one yourself using g_flags_register_static(). func FlagsRegisterStatic(NameVar string, ConstStaticValuesVar []FlagsValue) types.GType { cret := xFlagsRegisterStatic(NameVar, ConstStaticValuesVar) return cret } var xFlagsToString func(types.GType, uint) string // Pretty-prints @value in the form of the flag names separated by ` | ` and // sorted. Any extra bits will be shown at the end as a hexadecimal number. // // This is intended to be used for debugging purposes. The format of the output // may change in the future. func FlagsToString(FlagsTypeVar types.GType, ValueVar uint) string { cret := xFlagsToString(FlagsTypeVar, ValueVar) return cret } func init() { core.SetPackageName("GOBJECT", "gobject-2.0") core.SetSharedLibraries("GOBJECT", []string{"libgobject-2.0.so.0"}) var libs []uintptr for _, libPath := range core.GetPaths("GOBJECT") { lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL) if err != nil { panic(err) } libs = append(libs, lib) } core.PuregoSafeRegister(&xEnumCompleteTypeInfo, libs, "g_enum_complete_type_info") core.PuregoSafeRegister(&xEnumGetValue, libs, "g_enum_get_value") core.PuregoSafeRegister(&xEnumGetValueByName, libs, "g_enum_get_value_by_name") core.PuregoSafeRegister(&xEnumGetValueByNick, libs, "g_enum_get_value_by_nick") core.PuregoSafeRegister(&xEnumRegisterStatic, libs, "g_enum_register_static") core.PuregoSafeRegister(&xEnumToString, libs, "g_enum_to_string") core.PuregoSafeRegister(&xFlagsCompleteTypeInfo, libs, "g_flags_complete_type_info") core.PuregoSafeRegister(&xFlagsGetFirstValue, libs, "g_flags_get_first_value") core.PuregoSafeRegister(&xFlagsGetValueByName, libs, "g_flags_get_value_by_name") core.PuregoSafeRegister(&xFlagsGetValueByNick, libs, "g_flags_get_value_by_nick") core.PuregoSafeRegister(&xFlagsRegisterStatic, libs, "g_flags_register_static") core.PuregoSafeRegister(&xFlagsToString, libs, "g_flags_to_string") }