GIO Reference Manual: ExampleObject

## ExampleObject ExampleObject — Specialized GDBusObject types |

## Functions

ExampleAnimal * | example_object_get_animal ()
ExampleCat * | example_object_get_cat ()
ExampleAnimal * | example_object_peek_animal ()
ExampleCat * | example_object_peek_cat ()
ExampleObjectProxy * | example_object_proxy_new ()
ExampleObjectSkeleton * | example_object_skeleton_new ()
void | example_object_skeleton_set_animal ()
void | example_object_skeleton_set_cat ()

## Properties

ExampleAnimal * | animal | Read / Write
ExampleCat * | cat | Read / Write

## Types and Values

| ExampleObject
struct | ExampleObjectIface
struct | ExampleObjectProxy
struct | ExampleObjectProxyClass
struct | ExampleObjectSkeleton
struct | ExampleObjectSkeletonClass

## Object Hierarchy

        GInterface
        ╰── ExampleObject
        GObject
        ├── GDBusObjectProxy
        │   ╰── ExampleObjectProxy
        ╰── GDBusObjectSkeleton
            ╰── ExampleObjectSkeleton

## Prerequisites

ExampleObject requires GDBusObject and GObject.

## Implemented Interfaces

ExampleObjectProxy implements GDBusObject and ExampleObject.

ExampleObjectSkeleton implements GDBusObject and ExampleObject.

## Known Implementations

ExampleObject is implemented by ExampleObjectProxy and ExampleObjectSkeleton.

## Description

This section contains the ExampleObject, ExampleObjectProxy, and ExampleObjectSkeleton types which make it easier to work with objects implementing generated types for D-Bus interfaces.

## Functions

### example_object_get_animal ()

    ExampleAnimal *
    example_object_get_animal (ExampleObject *object);

Gets the ExampleAnimal instance for the D-Bus interface org.gtk.GDBus.Example.ObjectManager.Animal on `object` , if any.

#### Parameters

object | A ExampleObject. |

#### Returns

A ExampleAnimal that must be freed with `g_object_unref()` or `NULL` if `object` does not implement the interface.

[transfer full]

Since 2.30

### example_object_get_cat ()

    ExampleCat *
    example_object_get_cat (ExampleObject *object);

Gets the ExampleCat instance for the D-Bus interface org.gtk.GDBus.Example.ObjectManager.Cat on `object` , if any.

#### Parameters

object | A ExampleObject. |

#### Returns

A ExampleCat that must be freed with `g_object_unref()` or `NULL` if `object` does not implement the interface.

[transfer full]

### example_object_peek_animal ()

    ExampleAnimal *
    example_object_peek_animal (ExampleObject *object);

Like `example_object_get_animal()` but doesn't increase the reference count on the returned object.

It is not safe to use the returned object if you are on another thread than the one where the GDBusObjectManagerClient or GDBusObjectManagerServer for `object` is running.

#### Parameters

object | A ExampleObject. |

#### Returns

A ExampleAnimal or `NULL` if `object` does not implement the interface. Do not free the returned object, it is owned by `object` .

[transfer none]

Since 2.30

### example_object_peek_cat ()

    ExampleCat *
    example_object_peek_cat (ExampleObject *object);

Like `example_object_get_cat()` but doesn't increase the reference count on the returned object.

It is not safe to use the returned object if you are on another thread than the one where the GDBusObjectManagerClient or GDBusObjectManagerServer for `object` is running.

#### Parameters

object | A ExampleObject. |

#### Returns

A ExampleCat or `NULL` if `object` does not implement the interface. Do not free the returned object, it is owned by `object` .

[transfer none]

### example_object_proxy_new ()

    ExampleObjectProxy *
    example_object_proxy_new (GDBusConnection *connection,
                              const gchar *object_path);

Creates a new proxy object.

#### Parameters

connection | A GDBusConnection. |
object_path | An object path. |

#### Returns

The proxy object.

[transfer full]

### example_object_skeleton_new ()

    ExampleObjectSkeleton *
    example_object_skeleton_new (const gchar *object_path);

Creates a new skeleton object.

#### Parameters

object_path | An object path. |

#### Returns

The skeleton object.

[transfer full]

### example_object_skeleton_set_animal ()

    void
    example_object_skeleton_set_animal (ExampleObjectSkeleton *object,
                                        ExampleAnimal *interface_);

Sets the ExampleAnimal instance for the D-Bus interface org.gtk.GDBus.Example.ObjectManager.Animal on `object` .

#### Parameters

object | A ExampleObjectSkeleton. |
interface_ | A ExampleAnimal or `NULL` to clear the interface. | [allow-none]

Since 2.30

### example_object_skeleton_set_cat ()

    void
    example_object_skeleton_set_cat (ExampleObjectSkeleton *object,
                                     ExampleCat *interface_);

Sets the ExampleCat instance for the D-Bus interface org.gtk.GDBus.Example.ObjectManager.Cat on `object` .

#### Parameters

object | A ExampleObjectSkeleton. |
interface_ | A ExampleCat or `NULL` to clear the interface. | [allow-none]

## Types and Values

### ExampleObject

    typedef struct _ExampleObject ExampleObject;

The ExampleObject type is a specialized container of interfaces.

### struct ExampleObjectIface

    struct ExampleObjectIface {
      GTypeInterface parent_iface;
    };

Virtual table for the ExampleObject interface.

#### Members

GTypeInterface `parent_iface`; | The parent interface. |

### struct ExampleObjectProxy

    struct ExampleObjectProxy;

The ExampleObjectProxy structure contains only private data and should only be accessed using the provided API.

### struct ExampleObjectProxyClass

    struct ExampleObjectProxyClass {
      GDBusObjectProxyClass parent_class;
    };

Class structure for ExampleObjectProxy.

#### Members

GDBusObjectProxyClass `parent_class`; | The parent class. |

### struct ExampleObjectSkeleton

    struct ExampleObjectSkeleton;

The ExampleObjectSkeleton structure contains only private data and should only be accessed using the provided API.

### struct ExampleObjectSkeletonClass

    struct ExampleObjectSkeletonClass {
      GDBusObjectSkeletonClass parent_class;
    };

Class structure for ExampleObjectSkeleton.

#### Members

GDBusObjectSkeletonClass `parent_class`; | The parent class. |

## Property Details

### The `“animal”` property

      “animal”                   ExampleAnimal *

The ExampleAnimal instance corresponding to the D-Bus interface org.gtk.GDBus.Example.ObjectManager.Animal, if any.

Connect to the “notify” signal to get informed of property changes.

Flags: Read / Write

Since 2.30

### The `“cat”` property

      “cat”                      ExampleCat *

The ExampleCat instance corresponding to the D-Bus interface org.gtk.GDBus.Example.ObjectManager.Cat, if any.

Connect to the “notify” signal to get informed of property changes.

Flags: Read / Write