GDBusInterface: GIO Reference Manual

## GDBusInterface GDBusInterface — Base type for D-Bus interfaces |

## Functions

GDBusInterfaceInfo * | g_dbus_interface_get_info ()
GDBusObject * | g_dbus_interface_get_object ()
GDBusObject * | g_dbus_interface_dup_object ()
void | g_dbus_interface_set_object ()

## Types and Values

| GDBusInterface
struct | GDBusInterfaceIface

## Object Hierarchy

        GInterface
        ╰── GDBusInterface

## Prerequisites

GDBusInterface requires GObject.

## Known Implementations

GDBusInterface is implemented by GDBusInterfaceSkeleton and GDBusProxy.

## Includes

    #include <gio/gio.h>

## Description

The GDBusInterface type is the base type for D-Bus interfaces both on the service side (see GDBusInterfaceSkeleton) and client side (see GDBusProxy).

## Functions

### g_dbus_interface_get_info ()

    GDBusInterfaceInfo *
    g_dbus_interface_get_info (GDBusInterface *interface_);

Gets D-Bus introspection information for the D-Bus interface implemented by `interface_` .

#### Parameters

interface_ | An exported D-Bus interface. |

#### Returns

A GDBusInterfaceInfo. Do not free.

[transfer none]

Since: 2.30

### g_dbus_interface_get_object ()

    GDBusObject *
    g_dbus_interface_get_object (GDBusInterface *interface_);

Gets the GDBusObject that `interface_` belongs to, if any.

It is not safe to use the returned object if `interface_` or the returned object is being used from other threads. See `g_dbus_interface_dup_object()` for a thread-safe alternative.

[skip]

#### Parameters

interface_ | An exported D-Bus interface |

#### Returns

A GDBusObject or `NULL`. The returned reference belongs to `interface_` and should not be freed.

[transfer none]

Since: 2.30

### g_dbus_interface_dup_object ()

    GDBusObject *
    g_dbus_interface_dup_object (GDBusInterface *interface_);

Gets the GDBusObject that `interface_` belongs to, if any.

[rename-to g_dbus_interface_get_object]

#### Parameters

interface_ | An exported D-Bus interface. |

#### Returns

A GDBusObject or `NULL`. The returned reference should be freed with `g_object_unref()`.

[transfer full]

Since: 2.32

### g_dbus_interface_set_object ()

    void
    g_dbus_interface_set_object (GDBusInterface *interface_,
                                 GDBusObject *object);

Sets the GDBusObject for `interface_` to `object` .

Note that `interface_` will hold a weak reference to `object` .

#### Parameters

interface_ | An exported D-Bus interface. |
object | A GDBusObject or `NULL`. | [allow-none]

Since: 2.30

## Types and Values

### GDBusInterface

    typedef struct _GDBusInterface GDBusInterface;

Base type for D-Bus interfaces.

Since: 2.30

### struct GDBusInterfaceIface

    struct GDBusInterfaceIface {
      GTypeInterface parent_iface;

      /* Virtual Functions */
      GDBusInterfaceInfo   *(*get_info)   (GDBusInterface      *interface_);
      GDBusObject          *(*get_object) (GDBusInterface      *interface_);
      void                  (*set_object) (GDBusInterface      *interface_,
                                           GDBusObject         *object);
      GDBusObject          *(*dup_object) (GDBusInterface      *interface_);
    };

Base type for D-Bus interfaces.

#### Members

GTypeInterface `parent_iface`; | The parent interface. |
`get_info` () | Returns a GDBusInterfaceInfo. See `g_dbus_interface_get_info()`. |
`get_object` () | Gets the enclosing GDBusObject. See `g_dbus_interface_get_object()`. |
`set_object` () | Sets the enclosing GDBusObject. See `g_dbus_interface_set_object()`. |
`dup_object` () | Gets a reference to the enclosing GDBusObject. See `g_dbus_interface_dup_object()`. Added in 2.32. |

Since: 2.30