## GDBusObject

GDBusObject — Base type for D-Bus objects

## Functions

const gchar * | g_dbus_object_get_object_path ()
GList * | g_dbus_object_get_interfaces ()
GDBusInterface * | g_dbus_object_get_interface ()

## Signals

void | interface-added | Run Last
void | interface-removed | Run Last

## Types and Values

| GDBusObject
struct | GDBusObjectIface

## Object Hierarchy

        GInterface
        ╰── GDBusObject

## Prerequisites

GDBusObject requires GObject.

## Known Implementations

GDBusObject is implemented by GDBusObjectProxy and GDBusObjectSkeleton.

## Includes

    #include <gio/gio.h>

## Description

The GDBusObject type is the base type for D-Bus objects on both the service side (see GDBusObjectSkeleton) and the client side (see GDBusObjectProxy). It is essentially just a container of interfaces.

## Functions

### g_dbus_object_get_object_path ()

    const gchar *
    g_dbus_object_get_object_path (GDBusObject *object);

Gets the object path for `object` .

#### Parameters

object | A GDBusObject. |

#### Returns

A string owned by `object` . Do not free.

Since 2.30

### g_dbus_object_get_interfaces ()

    GList *
    g_dbus_object_get_interfaces (GDBusObject *object);

Gets the D-Bus interfaces associated with `object` .

#### Parameters

object | A GDBusObject. |

#### Returns

(element-type GDBusInterface) (transfer full) : A list of GDBusInterface instances. The returned list must be freed by `g_list_free()` after each element has been freed with `g_object_unref()`.

Since 2.30

### g_dbus_object_get_interface ()

    GDBusInterface *
    g_dbus_object_get_interface (GDBusObject *object,
                                 const gchar *interface_name);

Gets the D-Bus interface with name `interface_name` associated with `object` , if any.

#### Parameters

object | A GDBusObject. |
interface_name | A D-Bus interface name. |

#### Returns

`NULL` if not found, otherwise a GDBusInterface that must be freed with `g_object_unref()`.

[transfer full]

Since 2.30

## Types and Values

### GDBusObject

    typedef struct _GDBusObject GDBusObject;

### struct GDBusObjectIface

    struct GDBusObjectIface {
      GTypeInterface parent_iface;

      /* Virtual Functions */
      const gchar     *(*get_object_path) (GDBusObject  *object);
      GList           *(*get_interfaces)  (GDBusObject  *object);
      GDBusInterface  *(*get_interface)   (GDBusObject  *object,
                                           const gchar  *interface_name);

      /* Signals */
      void (*interface_added)   (GDBusObject     *object,
                                 GDBusInterface  *interface_);
      void (*interface_removed) (GDBusObject     *object,
                                 GDBusInterface  *interface_);
    };

Base object type for D-Bus objects.

#### Members

GTypeInterface `parent_iface`; | The parent interface. |
`get_object_path` () | Returns the object path. See `g_dbus_object_get_object_path()`. |
`get_interfaces` () | Returns all interfaces. See `g_dbus_object_get_interfaces()`. |
`get_interface` () | Returns an interface by name. See `g_dbus_object_get_interface()`. |
`interface_added` () | Signal handler for the “interface-added” signal. |
`interface_removed` () | Signal handler for the “interface-removed” signal. |

Since 2.30

## Signal Details

### The `“interface-added”` signal

    void
    user_function (GDBusObject    *object,
                   GDBusInterface *interface,
                   gpointer        user_data)

Emitted when `interface` is added to `object` .

#### Parameters

object | The GDBusObject emitting the signal. |
interface | The GDBusInterface that was added. |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

Since 2.30

### The `“interface-removed”` signal

    void
    user_function (GDBusObject    *object,
                   GDBusInterface *interface,
                   gpointer        user_data)

Emitted when `interface` is removed from `object` .

#### Parameters

object | The GDBusObject emitting the signal. |
interface | The GDBusInterface that was removed. |
user_data | user data set when the signal handler was connected. |

Flags: Run Last

Since 2.30