// Package gio was automatically generated by github.com/bnema/puregotk DO NOT EDIT package gio import ( "github.com/ebitengine/purego" "github.com/bnema/puregotk/pkg/core" "github.com/bnema/puregotk/v4/glib" "github.com/bnema/puregotk/v4/gobject" "github.com/bnema/puregotk/v4/gobject/types" ) const ( // The value returned by handlers of the signals generated by // the `gdbus-codegen` tool to indicate that a method call has been // handled by an implementation. It is equal to %TRUE, but using // this macro is sometimes more readable. // // In code that needs to be backwards-compatible with older GLib, // use %TRUE instead, often written like this: // // |[ // g_dbus_method_invocation_return_error (invocation, ...); // return TRUE; // handled // ]| DBUS_METHOD_INVOCATION_HANDLED bool = true // The value returned by handlers of the signals generated by // the `gdbus-codegen` tool to indicate that a method call has not been // handled by an implementation. It is equal to %FALSE, but using // this macro is sometimes more readable. // // In code that needs to be backwards-compatible with older GLib, // use %FALSE instead. DBUS_METHOD_INVOCATION_UNHANDLED bool = false ) // Instances of the `GDBusMethodInvocation` class are used when // handling D-Bus method calls. It provides a way to asynchronously // return results and errors. // // The normal way to obtain a `GDBusMethodInvocation` object is to receive // it as an argument to the `handle_method_call()` function in a // [type@Gio.DBusInterfaceVTable] that was passed to // [method@Gio.DBusConnection.register_object]. type DBusMethodInvocation struct { gobject.Object } var xDBusMethodInvocationGLibType func() types.GType func DBusMethodInvocationGLibType() types.GType { return xDBusMethodInvocationGLibType() } func DBusMethodInvocationNewFromInternalPtr(ptr uintptr) *DBusMethodInvocation { cls := &DBusMethodInvocation{} cls.Ptr = ptr return cls } var xDBusMethodInvocationGetConnection func(uintptr) uintptr // Gets the #GDBusConnection the method was invoked on. func (x *DBusMethodInvocation) GetConnection() *DBusConnection { var cls *DBusConnection cret := xDBusMethodInvocationGetConnection(x.GoPointer()) if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &DBusConnection{} cls.Ptr = cret return cls } var xDBusMethodInvocationGetInterfaceName func(uintptr) string // Gets the name of the D-Bus interface the method was invoked on. // // This can be `NULL` if it was not specified by the sender. See // [callback@Gio.DBusInterfaceMethodCallFunc] or the // [D-Bus Specification](https://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-types-method) // for details on when this can happen and how it should be handled. // // If this method call is a property Get, Set or GetAll call that has // been redirected to the method call handler then // "org.freedesktop.DBus.Properties" will be returned. See // #GDBusInterfaceVTable for more information. func (x *DBusMethodInvocation) GetInterfaceName() string { cret := xDBusMethodInvocationGetInterfaceName(x.GoPointer()) return cret } var xDBusMethodInvocationGetMessage func(uintptr) uintptr // Gets the #GDBusMessage for the method invocation. This is useful if // you need to use low-level protocol features, such as UNIX file // descriptor passing, that cannot be properly expressed in the // #GVariant API. // // See this [server][class@Gio.DBusConnection#an-example-d-bus-server] // and [client][class@Gio.DBusConnection#an-example-for-file-descriptor-passing] // for an example of how to use this low-level API to send and receive // UNIX file descriptors. func (x *DBusMethodInvocation) GetMessage() *DBusMessage { var cls *DBusMessage cret := xDBusMethodInvocationGetMessage(x.GoPointer()) if cret == 0 { return nil } gobject.IncreaseRef(cret) cls = &DBusMessage{} cls.Ptr = cret return cls } var xDBusMethodInvocationGetMethodInfo func(uintptr) *DBusMethodInfo // Gets information about the method call, if any. // // If this method invocation is a property Get, Set or GetAll call that // has been redirected to the method call handler then %NULL will be // returned. See g_dbus_method_invocation_get_property_info() and // #GDBusInterfaceVTable for more information. func (x *DBusMethodInvocation) GetMethodInfo() *DBusMethodInfo { cret := xDBusMethodInvocationGetMethodInfo(x.GoPointer()) return cret } var xDBusMethodInvocationGetMethodName func(uintptr) string // Gets the name of the method that was invoked. func (x *DBusMethodInvocation) GetMethodName() string { cret := xDBusMethodInvocationGetMethodName(x.GoPointer()) return cret } var xDBusMethodInvocationGetObjectPath func(uintptr) string // Gets the object path the method was invoked on. func (x *DBusMethodInvocation) GetObjectPath() string { cret := xDBusMethodInvocationGetObjectPath(x.GoPointer()) return cret } var xDBusMethodInvocationGetParameters func(uintptr) *glib.Variant // Gets the parameters of the method invocation. If there are no input // parameters then this will return a GVariant with 0 children rather than NULL. func (x *DBusMethodInvocation) GetParameters() *glib.Variant { cret := xDBusMethodInvocationGetParameters(x.GoPointer()) return cret } var xDBusMethodInvocationGetPropertyInfo func(uintptr) *DBusPropertyInfo // Gets information about the property that this method call is for, if // any. // // This will only be set in the case of an invocation in response to a // property Get or Set call that has been directed to the method call // handler for an object on account of its property_get() or // property_set() vtable pointers being unset. // // See #GDBusInterfaceVTable for more information. // // If the call was GetAll, %NULL will be returned. func (x *DBusMethodInvocation) GetPropertyInfo() *DBusPropertyInfo { cret := xDBusMethodInvocationGetPropertyInfo(x.GoPointer()) return cret } var xDBusMethodInvocationGetSender func(uintptr) string // Gets the bus name that invoked the method. // // This can return %NULL if not specified by the caller, e.g. on peer-to-peer // connections. func (x *DBusMethodInvocation) GetSender() string { cret := xDBusMethodInvocationGetSender(x.GoPointer()) return cret } var xDBusMethodInvocationGetUserData func(uintptr) uintptr // Gets the @user_data #gpointer passed to g_dbus_connection_register_object(). func (x *DBusMethodInvocation) GetUserData() uintptr { cret := xDBusMethodInvocationGetUserData(x.GoPointer()) return cret } var xDBusMethodInvocationReturnDbusError func(uintptr, string, string) // Finishes handling a D-Bus method call by returning an error. // // This method will take ownership of @invocation. See // #GDBusInterfaceVTable for more information about the ownership of // @invocation. func (x *DBusMethodInvocation) ReturnDbusError(ErrorNameVar string, ErrorMessageVar string) { xDBusMethodInvocationReturnDbusError(x.GoPointer(), ErrorNameVar, ErrorMessageVar) } var xDBusMethodInvocationReturnError func(uintptr, glib.Quark, int, string, ...interface{}) // Finishes handling a D-Bus method call by returning an error. // // See g_dbus_error_encode_gerror() for details about what error name // will be returned on the wire. In a nutshell, if the given error is // registered using g_dbus_error_register_error() the name given // during registration is used. Otherwise, a name of the form // `org.gtk.GDBus.UnmappedGError.Quark...` is used. This provides // transparent mapping of #GError between applications using GDBus. // // If you are writing an application intended to be portable, // always register errors with g_dbus_error_register_error() // or use g_dbus_method_invocation_return_dbus_error(). // // This method will take ownership of @invocation. See // #GDBusInterfaceVTable for more information about the ownership of // @invocation. // // Since 2.48, if the method call requested for a reply not to be sent // then this call will free @invocation but otherwise do nothing (as per // the recommendations of the D-Bus specification). func (x *DBusMethodInvocation) ReturnError(DomainVar glib.Quark, CodeVar int, FormatVar string, varArgs ...interface{}) { xDBusMethodInvocationReturnError(x.GoPointer(), DomainVar, CodeVar, FormatVar, varArgs...) } var xDBusMethodInvocationReturnErrorLiteral func(uintptr, glib.Quark, int, string) // Like g_dbus_method_invocation_return_error() but without printf()-style formatting. // // This method will take ownership of @invocation. See // #GDBusInterfaceVTable for more information about the ownership of // @invocation. func (x *DBusMethodInvocation) ReturnErrorLiteral(DomainVar glib.Quark, CodeVar int, MessageVar string) { xDBusMethodInvocationReturnErrorLiteral(x.GoPointer(), DomainVar, CodeVar, MessageVar) } var xDBusMethodInvocationReturnErrorValist func(uintptr, glib.Quark, int, string, []interface{}) // Like g_dbus_method_invocation_return_error() but intended for // language bindings. // // This method will take ownership of @invocation. See // #GDBusInterfaceVTable for more information about the ownership of // @invocation. func (x *DBusMethodInvocation) ReturnErrorValist(DomainVar glib.Quark, CodeVar int, FormatVar string, VarArgsVar []interface{}) { xDBusMethodInvocationReturnErrorValist(x.GoPointer(), DomainVar, CodeVar, FormatVar, VarArgsVar) } var xDBusMethodInvocationReturnGerror func(uintptr, *glib.Error) // Like g_dbus_method_invocation_return_error() but takes a #GError // instead of the error domain, error code and message. // // This method will take ownership of @invocation. See // #GDBusInterfaceVTable for more information about the ownership of // @invocation. func (x *DBusMethodInvocation) ReturnGerror(ErrorVar *glib.Error) { xDBusMethodInvocationReturnGerror(x.GoPointer(), ErrorVar) } var xDBusMethodInvocationReturnValue func(uintptr, *glib.Variant) // Finishes handling a D-Bus method call by returning @parameters. // If the @parameters GVariant is floating, it is consumed. // // It is an error if @parameters is not of the right format: it must be a tuple // containing the out-parameters of the D-Bus method. Even if the method has a // single out-parameter, it must be contained in a tuple. If the method has no // out-parameters, @parameters may be %NULL or an empty tuple. // // |[<!-- language="C" --> // GDBusMethodInvocation *invocation = some_invocation; // g_autofree gchar *result_string = NULL; // g_autoptr (GError) error = NULL; // // result_string = calculate_result (&error); // // if (error != NULL) // // g_dbus_method_invocation_return_gerror (invocation, error); // // else // // g_dbus_method_invocation_return_value (invocation, // g_variant_new ("(s)", result_string)); // // // Do not free @invocation here; returning a value does that // ]| // // This method will take ownership of @invocation. See // #GDBusInterfaceVTable for more information about the ownership of // @invocation. // // Since 2.48, if the method call requested for a reply not to be sent // then this call will sink @parameters and free @invocation, but // otherwise do nothing (as per the recommendations of the D-Bus // specification). func (x *DBusMethodInvocation) ReturnValue(ParametersVar *glib.Variant) { xDBusMethodInvocationReturnValue(x.GoPointer(), ParametersVar) } var xDBusMethodInvocationReturnValueWithUnixFdList func(uintptr, *glib.Variant, uintptr) // Like g_dbus_method_invocation_return_value() but also takes a #GUnixFDList. // // This method is only available on UNIX. // // This method will take ownership of @invocation. See // #GDBusInterfaceVTable for more information about the ownership of // @invocation. func (x *DBusMethodInvocation) ReturnValueWithUnixFdList(ParametersVar *glib.Variant, FdListVar *UnixFDList) { xDBusMethodInvocationReturnValueWithUnixFdList(x.GoPointer(), ParametersVar, FdListVar.GoPointer()) } var xDBusMethodInvocationTakeError func(uintptr, *glib.Error) // Like g_dbus_method_invocation_return_gerror() but takes ownership // of @error so the caller does not need to free it. // // This method will take ownership of @invocation. See // #GDBusInterfaceVTable for more information about the ownership of // @invocation. func (x *DBusMethodInvocation) TakeError(ErrorVar *glib.Error) { xDBusMethodInvocationTakeError(x.GoPointer(), ErrorVar) } func (c *DBusMethodInvocation) GoPointer() uintptr { if c == nil { return 0 } return c.Ptr } func (c *DBusMethodInvocation) SetGoPointer(ptr uintptr) { c.Ptr = ptr } func init() { core.SetPackageName("GIO", "gio-2.0") core.SetSharedLibraries("GIO", []string{"libgio-2.0.so.0"}) var libs []uintptr for _, libPath := range core.GetPaths("GIO") { lib, err := purego.Dlopen(libPath, purego.RTLD_NOW|purego.RTLD_GLOBAL) if err != nil { panic(err) } libs = append(libs, lib) } core.PuregoSafeRegister(&xDBusMethodInvocationGLibType, libs, "g_dbus_method_invocation_get_type") core.PuregoSafeRegister(&xDBusMethodInvocationGetConnection, libs, "g_dbus_method_invocation_get_connection") core.PuregoSafeRegister(&xDBusMethodInvocationGetInterfaceName, libs, "g_dbus_method_invocation_get_interface_name") core.PuregoSafeRegister(&xDBusMethodInvocationGetMessage, libs, "g_dbus_method_invocation_get_message") core.PuregoSafeRegister(&xDBusMethodInvocationGetMethodInfo, libs, "g_dbus_method_invocation_get_method_info") core.PuregoSafeRegister(&xDBusMethodInvocationGetMethodName, libs, "g_dbus_method_invocation_get_method_name") core.PuregoSafeRegister(&xDBusMethodInvocationGetObjectPath, libs, "g_dbus_method_invocation_get_object_path") core.PuregoSafeRegister(&xDBusMethodInvocationGetParameters, libs, "g_dbus_method_invocation_get_parameters") core.PuregoSafeRegister(&xDBusMethodInvocationGetPropertyInfo, libs, "g_dbus_method_invocation_get_property_info") core.PuregoSafeRegister(&xDBusMethodInvocationGetSender, libs, "g_dbus_method_invocation_get_sender") core.PuregoSafeRegister(&xDBusMethodInvocationGetUserData, libs, "g_dbus_method_invocation_get_user_data") core.PuregoSafeRegister(&xDBusMethodInvocationReturnDbusError, libs, "g_dbus_method_invocation_return_dbus_error") core.PuregoSafeRegister(&xDBusMethodInvocationReturnError, libs, "g_dbus_method_invocation_return_error") core.PuregoSafeRegister(&xDBusMethodInvocationReturnErrorLiteral, libs, "g_dbus_method_invocation_return_error_literal") core.PuregoSafeRegister(&xDBusMethodInvocationReturnErrorValist, libs, "g_dbus_method_invocation_return_error_valist") core.PuregoSafeRegister(&xDBusMethodInvocationReturnGerror, libs, "g_dbus_method_invocation_return_gerror") core.PuregoSafeRegister(&xDBusMethodInvocationReturnValue, libs, "g_dbus_method_invocation_return_value") core.PuregoSafeRegister(&xDBusMethodInvocationReturnValueWithUnixFdList, libs, "g_dbus_method_invocation_return_value_with_unix_fd_list") core.PuregoSafeRegister(&xDBusMethodInvocationTakeError, libs, "g_dbus_method_invocation_take_error") }