MIRAGE_Object object

MIRAGE_Object object

Synopsis

#include <mirage.h>

                    MIRAGE_Object;
gboolean            mirage_object_set_debug_context     (MIRAGE_Object *self,
                                                         GObject *debug_context,
                                                         GError **error);
gboolean            mirage_object_get_debug_context     (MIRAGE_Object *self,
                                                         GObject **debug_context,
                                                         GError **error);
void                mirage_object_debug_message         (MIRAGE_Object *self,
                                                         gint level,
                                                         gchar *format,
                                                         ...);
void                mirage_object_debug_messagev        (MIRAGE_Object *self,
                                                         gint level,
                                                         gchar *format,
                                                         va_list args);
gboolean            mirage_object_set_parent            (MIRAGE_Object *self,
                                                         GObject *parent,
                                                         GError **error);
gboolean            mirage_object_get_parent            (MIRAGE_Object *self,
                                                         GObject **parent,
                                                         GError **error);
gboolean            mirage_object_attach_child          (MIRAGE_Object *self,
                                                         GObject *child,
                                                         GError **error);
gboolean            mirage_object_detach_child          (MIRAGE_Object *self,
                                                         GObject *child,
                                                         GError **error);

Description

Details

MIRAGE_Object

typedef struct {
    GObject parent;
} MIRAGE_Object;

Contains private data only, and should be accessed using the functions below.


mirage_object_set_debug_context ()

gboolean            mirage_object_set_debug_context     (MIRAGE_Object *self,
                                                         GObject *debug_context,
                                                         GError **error);

Sets object's debug context.

self :

a MIRAGE_Object

debug_context :

debug context

error :

location to store error, or NULL

Returns :

TRUE on success, FALSE on failure

mirage_object_get_debug_context ()

gboolean            mirage_object_get_debug_context     (MIRAGE_Object *self,
                                                         GObject **debug_context,
                                                         GError **error);

Retrieves object's debug context. A reference to debug context is stored in debug_context; it should be released with g_object_unref() when no longer needed.

self :

a MIRAGE_Object

debug_context :

location to store debug context, or NULL

error :

location to store error, or NULL

Returns :

TRUE on success, FALSE on failure

mirage_object_debug_message ()

void                mirage_object_debug_message         (MIRAGE_Object *self,
                                                         gint level,
                                                         gchar *format,
                                                         ...);

Outputs debug message with verbosity level level, format string format and format arguments Varargs. The message is displayed if object's debug context has mask that covers level, or if level is either MIRAGE_DEBUG_WARNING or MIRAGE_DEBUG_ERROR.

self :

a MIRAGE_Object

level :

debug level

format :

message format. See the printf() documentation.

... :

parameters to insert into the format string.

mirage_object_debug_messagev ()

void                mirage_object_debug_messagev        (MIRAGE_Object *self,
                                                         gint level,
                                                         gchar *format,
                                                         va_list args);

Outputs debug message with verbosity level level, format string format and format arguments args. The message is displayed if object's debug context has mask that covers level, or if level is either MIRAGE_DEBUG_WARNING or MIRAGE_DEBUG_ERROR.

self :

a MIRAGE_Object

level :

debug level

format :

message format. See the printf() documentation.

args :

parameters to insert into the format string.

mirage_object_set_parent ()

gboolean            mirage_object_set_parent            (MIRAGE_Object *self,
                                                         GObject *parent,
                                                         GError **error);

Sets object's parent.

self :

a MIRAGE_Object

parent :

parent

error :

location to store error, or NULL

Returns :

TRUE on success, FALSE on failure

mirage_object_get_parent ()

gboolean            mirage_object_get_parent            (MIRAGE_Object *self,
                                                         GObject **parent,
                                                         GError **error);

Retrieves object's parent.

self :

a MIRAGE_Object

parent :

location to store parent, or NULL

error :

location to store error, or NULL

Returns :

TRUE on success, FALSE on failure

mirage_object_attach_child ()

gboolean            mirage_object_attach_child          (MIRAGE_Object *self,
                                                         GObject *child,
                                                         GError **error);

Attaches child to the object.

self :

a MIRAGE_Object

child :

child

error :

location to store error, or NULL

Returns :

TRUE on success, FALSE on failure

mirage_object_detach_child ()

gboolean            mirage_object_detach_child          (MIRAGE_Object *self,
                                                         GObject *child,
                                                         GError **error);

Detaches child from the object. Note that the child will keep the debug context it may have been passed to while being attached to the parent.

self :

a MIRAGE_Object

child :

child

error :

location to store error, or NULL

Returns :

TRUE on success, FALSE on failure