// Package glib was automatically generated by github.com/bnema/puregotk DO NOT EDIT package glib import ( "github.com/ebitengine/purego" "github.com/bnema/puregotk/pkg/core" ) var xDcgettext func(uintptr, string, int) string // This is a variant of g_dgettext() that allows specifying a locale // category instead of always using `LC_MESSAGES`. See g_dgettext() for // more information about how this functions differs from calling // dcgettext() directly. func Dcgettext(DomainVar *string, MsgidVar string, CategoryVar int) string { DomainVarPtr := core.GStrdupNullable(DomainVar) defer core.GFreeNullable(DomainVarPtr) cret := xDcgettext(DomainVarPtr, MsgidVar, CategoryVar) return cret } var xDgettext func(uintptr, string) string // This function is a wrapper of dgettext() which does not translate // the message if the default domain as set with textdomain() has no // translations for the current locale. // // The advantage of using this function over dgettext() proper is that // libraries using this function (like GTK) will not use translations // if the application using the library does not have translations for // the current locale. This results in a consistent English-only // interface instead of one having partial translations. For this // feature to work, the call to textdomain() and setlocale() should // precede any g_dgettext() invocations. For GTK, it means calling // textdomain() before gtk_init or its variants. // // This function disables translations if and only if upon its first // call all the following conditions hold: // // - @domain is not %NULL // // - textdomain() has been called to set a default text domain // // - there is no translations available for the default text domain // and the current locale // // - current locale is not "C" or any English locales (those // starting with "en_") // // Note that this behavior may not be desired for example if an application // has its untranslated messages in a language other than English. In those // cases the application should call textdomain() after initializing GTK. // // Applications should normally not use this function directly, // but use the _() macro for translations. func Dgettext(DomainVar *string, MsgidVar string) string { DomainVarPtr := core.GStrdupNullable(DomainVar) defer core.GFreeNullable(DomainVarPtr) cret := xDgettext(DomainVarPtr, MsgidVar) return cret } var xDngettext func(uintptr, string, string, uint) string // This function is a wrapper of dngettext() which does not translate // the message if the default domain as set with textdomain() has no // translations for the current locale. // // See g_dgettext() for details of how this differs from dngettext() // proper. func Dngettext(DomainVar *string, MsgidVar string, MsgidPluralVar string, NVar uint) string { DomainVarPtr := core.GStrdupNullable(DomainVar) defer core.GFreeNullable(DomainVarPtr) cret := xDngettext(DomainVarPtr, MsgidVar, MsgidPluralVar, NVar) return cret } var xDpgettext func(uintptr, string, uint) string // This function is a variant of g_dgettext() which supports // a disambiguating message context. GNU gettext uses the // '\004' character to separate the message context and // message id in @msgctxtid. // If 0 is passed as @msgidoffset, this function will fall back to // trying to use the deprecated convention of using "|" as a separation // character. // // This uses g_dgettext() internally. See that functions for differences // with dgettext() proper. // // Applications should normally not use this function directly, // but use the C_() macro for translations with context. func Dpgettext(DomainVar *string, MsgctxtidVar string, MsgidoffsetVar uint) string { DomainVarPtr := core.GStrdupNullable(DomainVar) defer core.GFreeNullable(DomainVarPtr) cret := xDpgettext(DomainVarPtr, MsgctxtidVar, MsgidoffsetVar) return cret } var xDpgettext2 func(uintptr, string, string) string // This function is a variant of g_dgettext() which supports // a disambiguating message context. GNU gettext uses the // '\004' character to separate the message context and // message id in @msgctxtid. // // This uses g_dgettext() internally. See that functions for differences // with dgettext() proper. // // This function differs from C_() in that it is not a macro and // thus you may use non-string-literals as context and msgid arguments. func Dpgettext2(DomainVar *string, ContextVar string, MsgidVar string) string { DomainVarPtr := core.GStrdupNullable(DomainVar) defer core.GFreeNullable(DomainVarPtr) cret := xDpgettext2(DomainVarPtr, ContextVar, MsgidVar) return cret } var xStripContext func(string, string) string // An auxiliary function for gettext() support (see Q_()). func StripContext(MsgidVar string, MsgvalVar string) string { cret := xStripContext(MsgidVar, MsgvalVar) return cret } func init() { core.SetPackageName("GLIB", "glib-2.0") core.SetSharedLibraries("GLIB", []string{"libgobject-2.0.so.0", "libglib-2.0.so.0"}) var libs []uintptr for _, libPath := range core.GetPaths("GLIB") { lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL) if err != nil { panic(err) } libs = append(libs, lib) } core.PuregoSafeRegister(&xDcgettext, libs, "g_dcgettext") core.PuregoSafeRegister(&xDgettext, libs, "g_dgettext") core.PuregoSafeRegister(&xDngettext, libs, "g_dngettext") core.PuregoSafeRegister(&xDpgettext, libs, "g_dpgettext") core.PuregoSafeRegister(&xDpgettext2, libs, "g_dpgettext2") core.PuregoSafeRegister(&xStripContext, libs, "g_strip_context") }