GalagoObject

GalagoObject — The base class of the Galago object hierarchy.

Functions

Properties

gpointer context Read
GalagoOrigin origin Read / Write / Construct Only
gboolean supports-attrs Read

Signals

void destroy No Hooks

Types and Values

Object Hierarchy

    GObject
    ╰── GalagoObject
        ├── GalagoAccount
        ├── GalagoContext
        ├── GalagoCore
        ├── GalagoImage
        ├── GalagoPerson
        ├── GalagoPresence
        ├── GalagoService
        ╰── GalagoStatus

Description

GalagoObject is the base class for all Galago objects. Most GalagoObject subclasses can be passed around in D-BUS messages through galago_dbus_message_iter_append_object() and galago_dbus_message_iter_get_object().

GalagoObjects may also support remote attributes. Examples of such objects are GalagoPerson and GalagoAccount.

Most GalagoObjects are managed by the libgalago, and are created by factories. In most cases, you should not call g_object_unref() unless you've already called g_object_ref(). If you wish to destroy an object, call galago_object_destroy().

Functions

GALAGO_OBJECT_HAS_FLAG()

#define             GALAGO_OBJECT_HAS_FLAG(obj, flag)

Returns whether or not the object has the specified flag set.

Parameters

obj

The GalagoObject.

 

flag

The flag to check for.

 

GALAGO_OBJECT_FLAGS()

#define GALAGO_OBJECT_FLAGS(obj) (GALAGO_OBJECT(obj)->flags)

Returns the flags belonging to an object.

Parameters

obj

The GalagoObject.

 

GALAGO_OBJECT_SET_FLAGS()

#define             GALAGO_OBJECT_SET_FLAGS(obj, flag)

Sets one or more flags on an object.

Parameters

obj

The GalagoObject.

 

flag

A bitmask of flags to set.

 

GALAGO_OBJECT_UNSET_FLAGS()

#define             GALAGO_OBJECT_UNSET_FLAGS(obj, flag)

Unsets one or more flags on an object.

Parameters

obj

The GalagoObject.

 

flag

A bitmask of flags to unset.

 

GALAGO_ORIGIN_IS_VALID()

#define             GALAGO_ORIGIN_IS_VALID(origin)

Returns whether or not a numeric value is a valid GalagoOrigin value.

Parameters

origin

The value to test against.

 

GALAGO_OBJECT_IS_LOCAL()

#define             GALAGO_OBJECT_IS_LOCAL(obj)

Returns TRUE if an object is local. This is the same as comparing the result of galago_object_get_origin() to GALAGO_LOCAL.

Parameters

obj

The GalagoObject.

 

GALAGO_OBJECT_IS_REMOTE()

#define             GALAGO_OBJECT_IS_REMOTE(obj)

Returns TRUE if an object is remote. This is the same as comparing the result of galago_object_get_origin() to GALAGO_REMOTE.

Parameters

obj

The GalagoObject.

 

galago_object_destroy ()

void
galago_object_destroy (GalagoObject *object);

Emits the "destroy" signal for an object, and attempts to dispose of it. The memory for the object won't actually be deleted until the reference count drops to 0.

Parameters

object

The object to destroy.

 

galago_object_type_get_dbus_signature ()

const gchar *
galago_object_type_get_dbus_signature (GType type);

Returns the D-BUS signature of the object type.

Parameters

type

The object GType.

 

Returns

The signature string, or NULL.


galago_object_set_dbus_path ()

void
galago_object_set_dbus_path (GalagoObject *object,
                             const gchar *obj_path);

Sets the D-BUS object path of an object.

Parameters

object

The object.

 

obj_path

The object path.

 

galago_object_get_dbus_path ()

const gchar *
galago_object_get_dbus_path (const GalagoObject *object);

Returns the D-BUS object path of an object.

Parameters

object

The object.

 

Returns

The object path.


galago_object_set_watch ()

void
galago_object_set_watch (GalagoObject *object,
                         gboolean watch);

Sets whether or not this object is watched for events.

Parameters

object

The object.

 

watch

TRUE if this object should be watched, or FALSE.

 

galago_object_is_watched ()

gboolean
galago_object_is_watched (const GalagoObject *object);

Returns whether or not an object is watched for events.

Parameters

object

The object.

 

Returns

TRUE if this object is being watched, or FALSE.


galago_object_get_origin ()

GalagoOrigin
galago_object_get_origin (const GalagoObject *object);

Returns the object's origin.

Parameters

object

The object.

 

Returns

The object's origin


galago_object_get_context ()

GalagoContext *
galago_object_get_context (const GalagoObject *object);

Returns the object's context.

Parameters

object

The object.

 

Returns

The object's context.


galago_object_set_attr_string ()

void
galago_object_set_attr_string (GalagoObject *object,
                               const char *name,
                               const char *value);

Sets a string attribute on an object.

Parameters

object

The object.

 

name

The name of the attribute to set.

 

value

The value of the attribute.

 

galago_object_set_attr_bool ()

void
galago_object_set_attr_bool (GalagoObject *object,
                             const char *name,
                             gboolean value);

Sets a boolean attribute on an object.

Parameters

object

The object.

 

name

The name of the attribute to set.

 

value

The value of the attribute.

 

galago_object_set_attr_int ()

void
galago_object_set_attr_int (GalagoObject *object,
                            const char *name,
                            gint32 value);

Sets an integer attribute on an object.

Parameters

object

The object.

 

name

The name of the attribute to set.

 

value

The value of the attribute.

 

galago_object_set_attr_double ()

void
galago_object_set_attr_double (GalagoObject *object,
                               const char *name,
                               gdouble value);

Sets a double attribute on an object.

Parameters

object

The object.

 

name

The name of the attribute to set.

 

value

The value of the attribute.

 

galago_object_set_attribute ()

void
galago_object_set_attribute (GalagoObject *object,
                             const char *name,
                             GValue *value);

Sets an attribute on an object.

This is limited to string, boolean, and integer value types.

Parameters

object

The object.

 

name

The name of the attribute to set.

 

value

The value of the attribute.

 

galago_object_remove_attribute ()

gboolean
galago_object_remove_attribute (GalagoObject *object,
                                const char *name);

Removes an attribute on an object.

Parameters

object

The object

 

name

The name of the attribute to remove

 

Returns

TRUE if the attribute was removed, or FALSE.


galago_object_get_attr_string ()

const char *
galago_object_get_attr_string (const GalagoObject *object,
                               const char *name);

Returns the value of a string attribute on an object.

Parameters

object

The object.

 

name

The name of the attribute.

 

Returns

The attribute value, or NULL.


galago_object_get_attr_bool ()

gboolean
galago_object_get_attr_bool (const GalagoObject *object,
                             const char *name);

Returns the value of a boolean attribute on an object.

Parameters

object

The object.

 

name

The name of the attribute.

 

Returns

The attribute value.


galago_object_get_attr_int ()

gint32
galago_object_get_attr_int (const GalagoObject *object,
                            const char *name);

Returns the value of an integer attribute on an object.

Parameters

object

The object.

 

name

The name of the attribute.

 

Returns

The attribute value.


galago_object_get_attr_double ()

gdouble
galago_object_get_attr_double (const GalagoObject *object,
                               const char *name);

Returns the value of a double attribute on an object.

Parameters

object

The object.

 

name

The name of the attribute.

 

Returns

The attribute value.


galago_object_get_attribute ()

const GValue *
galago_object_get_attribute (const GalagoObject *object,
                             const char *name);

Returns the value of an attribute on an object.

Parameters

object

The object.

 

name

The name of the attribute.

 

Returns

The attribute value, or NULL.


galago_object_get_has_attribute ()

gboolean
galago_object_get_has_attribute (const GalagoObject *object,
                                 const char *name);

Returns whether or not an object has a specific attribute set.

Parameters

object

The object.

 

name

The name of the attribute.

 

Returns

TRUE if the attribute is set, or FALSE.


galago_object_get_attributes ()

GList *
galago_object_get_attributes (const GalagoObject *object);

Returns the list of attributes in an object, represented by GalagoKeyValue structs.

Parameters

object

The object.

 

Returns

The attributes in the object. Each one is a GalagoKeyValue.

Types and Values

struct GalagoObject

struct GalagoObject;

The object itself. You should never access the members of this directly. Always use the public API methods and macros.


enum GalagoObjectFlags

Object flags.

Members

GALAGO_OBJECT_IN_DESTRUCTION

The object is currently being destroyed. This is used internally.

 

GALAGO_OBJECT_RESERVED_1

Reserved for future use.

 

GALAGO_OBJECT_RESERVED_2

Reserved for future use.

 

enum GalagoOrigin

The origin of an object.

Members

GALAGO_LOCAL

The object is local to the calling application or library.

 

GALAGO_REMOTE

The object is remote and created from another process.

 

Property Details

The “context” property

  “context”                  gpointer

The GalagoContext this object belongs to.

Flags: Read


The “origin” property

  “origin”                   GalagoOrigin

The object's origin.

Flags: Read / Write / Construct Only

Default value: GALAGO_LOCAL


The “supports-attrs” property

  “supports-attrs”           gboolean

Indicates if this object supports remote attributes.

Flags: Read

Default value: FALSE

Signal Details

The “destroy” signal

void
user_function (GalagoObject *object,
               gpointer      user_data)

Emitted when the object is undergoing a dispose. Signals that anything holding a reference to this object should release the reference. This may or may not end with the object being finalized, depending on whether there are any references left after this is emitted.

Parameters

object

The object which received the signal.

 

user_data

user data set when the signal handler was connected.

 

Flags: No Hooks

See Also

GObject