![]() |
![]() |
![]() |
libgalago Reference Manual | ![]() |
---|---|---|---|---|
GalagoObject; enum GalagoObjectFlags; #define GALAGO_OBJECT_HAS_FLAG (obj, flag) #define GALAGO_OBJECT_FLAGS (obj) #define GALAGO_OBJECT_SET_FLAGS (obj, flag) #define GALAGO_OBJECT_UNSET_FLAGS (obj, flag) enum GalagoOrigin; #define GALAGO_ORIGIN_IS_VALID (origin) #define GALAGO_OBJECT_IS_LOCAL (obj) #define GALAGO_OBJECT_IS_REMOTE (obj) void galago_object_destroy (GalagoObject *object); const gchar* galago_object_type_get_dbus_signature (GType type); void galago_object_set_dbus_path (GalagoObject *object, const gchar *obj_path); const gchar* galago_object_get_dbus_path (const GalagoObject *object); void galago_object_set_watch (GalagoObject *object, gboolean watch); gboolean galago_object_is_watched (const GalagoObject *object); GalagoOrigin galago_object_get_origin (const GalagoObject *object); GalagoContext* galago_object_get_context (const GalagoObject *object); void galago_object_set_attr_string (GalagoObject *object, const char *name, const char *value); void galago_object_set_attr_bool (GalagoObject *object, const char *name, gboolean value); void galago_object_set_attr_int (GalagoObject *object, const char *name, gint32 value); void galago_object_set_attr_double (GalagoObject *object, const char *name, gdouble value); void galago_object_set_attribute (GalagoObject *object, const char *name, GValue *value); gboolean galago_object_remove_attribute (GalagoObject *object, const char *name); const char* galago_object_get_attr_string (const GalagoObject *object, const char *name); gboolean galago_object_get_attr_bool (const GalagoObject *object, const char *name); gint32 galago_object_get_attr_int (const GalagoObject *object, const char *name); gdouble galago_object_get_attr_double (const GalagoObject *object, const char *name); const GValue* galago_object_get_attribute (const GalagoObject *object, const char *name); gboolean galago_object_get_has_attribute (const GalagoObject *object, const char *name); GList* galago_object_get_attributes (const GalagoObject *object);
GObject +----GalagoObject +----GalagoAccount +----GalagoContext +----GalagoCore +----GalagoImage +----GalagoPerson +----GalagoPresence +----GalagoService +----GalagoStatus
"context" gpointer : Read "origin" GalagoOrigin : Read / Write / Construct Only "supports-attrs" gboolean : Read
"destroy" void user_function (GalagoObject *object, gpointer user_data) : Cleanup / No recursion / No hooks
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()
.
typedef struct _GalagoObject GalagoObject;
The object itself. You should never access the members of this directly. Always use the public API methods and macros.
typedef enum { GALAGO_OBJECT_IN_DESTRUCTION = 1, GALAGO_OBJECT_RESERVED_1 = 2, GALAGO_OBJECT_RESERVED_2 = 4 } GalagoObjectFlags;
Object flags.
#define GALAGO_OBJECT_HAS_FLAG(obj, flag)
Returns whether or not the object has the specified flag set.
obj : |
The GalagoObject. |
flag : |
The flag to check for. |
#define GALAGO_OBJECT_FLAGS(obj)
Returns the flags belonging to an object.
obj : |
The GalagoObject. |
#define GALAGO_OBJECT_SET_FLAGS(obj, flag)
Sets one or more flags on an object.
obj : |
The GalagoObject. |
flag : |
A bitmask of flags to set. |
#define GALAGO_OBJECT_UNSET_FLAGS(obj, flag)
Unsets one or more flags on an object.
obj : |
The GalagoObject. |
flag : |
A bitmask of flags to unset. |
typedef enum { GALAGO_LOCAL = 0, GALAGO_REMOTE } GalagoOrigin;
The origin of an object.
#define GALAGO_ORIGIN_IS_VALID(origin)
Returns whether or not a numeric value is a valid GalagoOrigin value.
origin : |
The value to test against. |
#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
.
obj : |
The GalagoObject. |
#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
.
obj : |
The GalagoObject. |
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.
object : |
The object to destroy. |
const gchar* galago_object_type_get_dbus_signature (GType type);
Returns the D-BUS signature of the object type.
type : |
The object GType. |
Returns : | The signature string, or NULL. |
void galago_object_set_dbus_path (GalagoObject *object, const gchar *obj_path);
Sets the D-BUS object path of an object.
object : |
The object. |
obj_path : |
The object path. |
const gchar* galago_object_get_dbus_path (const GalagoObject *object);
Returns the D-BUS object path of an object.
object : |
The object. |
Returns : | The object path. |
void galago_object_set_watch (GalagoObject *object, gboolean watch);
Sets whether or not this object is watched for events.
object : |
The object. |
watch : |
TRUE if this object should be watched, or FALSE .
|
gboolean galago_object_is_watched (const GalagoObject *object);
Returns whether or not an object is watched for events.
object : |
The object. |
Returns : | TRUE if this object is being watched, or FALSE .
|
GalagoOrigin galago_object_get_origin (const GalagoObject *object);
Returns the object's origin.
object : |
The object. |
Returns : | The object's origin |
GalagoContext* galago_object_get_context (const GalagoObject *object);
Returns the object's context.
object : |
The object. |
Returns : | The object's context. |
void galago_object_set_attr_string (GalagoObject *object, const char *name, const char *value);
Sets a string attribute on an object.
object : |
The object. |
name : |
The name of the attribute to set. |
value : |
The value of the attribute. |
void galago_object_set_attr_bool (GalagoObject *object, const char *name, gboolean value);
Sets a boolean attribute on an object.
object : |
The object. |
name : |
The name of the attribute to set. |
value : |
The value of the attribute. |
void galago_object_set_attr_int (GalagoObject *object, const char *name, gint32 value);
Sets an integer attribute on an object.
object : |
The object. |
name : |
The name of the attribute to set. |
value : |
The value of the attribute. |
void galago_object_set_attr_double (GalagoObject *object, const char *name, gdouble value);
Sets a double attribute on an object.
object : |
The object. |
name : |
The name of the attribute to set. |
value : |
The value of the 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.
object : |
The object. |
name : |
The name of the attribute to set. |
value : |
The value of the attribute. |
gboolean galago_object_remove_attribute (GalagoObject *object, const char *name);
Removes an attribute on an object.
object : |
The object |
name : |
The name of the attribute to remove |
Returns : | TRUE if the attribute was removed, or FALSE .
|
const char* galago_object_get_attr_string (const GalagoObject *object, const char *name);
Returns the value of a string attribute on an object.
object : |
The object. |
name : |
The name of the attribute. |
Returns : | The attribute value, or NULL. |
gboolean galago_object_get_attr_bool (const GalagoObject *object, const char *name);
Returns the value of a boolean attribute on an object.
object : |
The object. |
name : |
The name of the attribute. |
Returns : | The attribute value. |
gint32 galago_object_get_attr_int (const GalagoObject *object, const char *name);
Returns the value of an integer attribute on an object.
object : |
The object. |
name : |
The name of the attribute. |
Returns : | The attribute value. |
gdouble galago_object_get_attr_double (const GalagoObject *object, const char *name);
Returns the value of a double attribute on an object.
object : |
The object. |
name : |
The name of the attribute. |
Returns : | The attribute value. |
const GValue* galago_object_get_attribute (const GalagoObject *object, const char *name);
Returns the value of an attribute on an object.
object : |
The object. |
name : |
The name of the attribute. |
Returns : | The attribute value, or NULL. |
gboolean galago_object_get_has_attribute (const GalagoObject *object, const char *name);
Returns whether or not an object has a specific attribute set.
object : |
The object. |
name : |
The name of the attribute. |
Returns : | TRUE if the attribute is set, or FALSE .
|
GList* galago_object_get_attributes (const GalagoObject *object);
Returns the list of attributes in an object, represented by GalagoKeyValue structs.
object : |
The object. |
Returns : | The attributes in the object. Each one is a GalagoKeyValue. |
origin
" property"origin" GalagoOrigin : Read / Write / Construct Only
The object's origin.
Default value: GALAGO_LOCAL
void user_function (GalagoObject *object, gpointer user_data) : Cleanup / No recursion / No hooks
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.
object : |
The object which received the signal. |
user_data : |
user data set when the signal handler was connected. |