src/include/xmms/xmms_object.h File Reference

#include <glib.h>
#include "xmms/xmms_error.h"
#include "xmmsc/xmmsc_idnumbers.h"
#include "xmmsc/xmmsv.h"
#include "xmmsc/xmmsv_coll.h"

Go to the source code of this file.

Data Structures

struct  xmms_object_St
struct  xmms_object_cmd_arg_t
struct  xmms_object_cmd_desc_St

Defines

#define XMMS_OBJECT_MID   0x00455574
#define XMMS_OBJECT_CMD_MAX_ARGS   6
#define XMMS_OBJECT(p)   ((xmms_object_t *)p)
#define XMMS_IS_OBJECT(p)   (XMMS_OBJECT (p)->id == XMMS_OBJECT_MID)
#define __XMMS_CMD_INIT_ARG_FULL(argn, argtypecode, extract_func)
#define __XMMS_CMD_INIT_ARG(argn, argtype, argtypecode)   __XMMS_CMD_INIT_ARG_FULL(argn, argtypecode, xmmsv_get_##argtype)
#define __XMMS_CMD_INIT_ARG_NONE(a)
#define __XMMS_CMD_INIT_ARG_STRING(a)   __XMMS_CMD_INIT_ARG(a, string, const gchar *)
#define __XMMS_CMD_INIT_ARG_INT32(a)   __XMMS_CMD_INIT_ARG(a, int, gint)
#define __XMMS_CMD_INIT_ARG_COLL(a)   __XMMS_CMD_INIT_ARG(a, coll, xmmsv_coll_t *)
#define __XMMS_CMD_INIT_ARG_BIN(a)   __XMMS_CMD_INIT_ARG_FULL(a, GString *, xmms_bin_to_gstring)
#define __XMMS_CMD_INIT_ARG_LIST(a)   __XMMS_CMD_INIT_ARG_FULL(a, xmmsv_t *, dummy_identity)
#define __XMMS_CMD_INIT_ARG_DICT(a)   __XMMS_CMD_INIT_ARG_FULL(a, xmmsv_t *, dummy_identity)
#define __XMMS_CMD_PRINT_ARG_NONE(a)
#define __XMMS_CMD_PRINT_ARG_STRING(a)   , argval##a
#define __XMMS_CMD_PRINT_ARG_INT32(a)   , argval##a
#define __XMMS_CMD_PRINT_ARG_COLL(a)   , argval##a
#define __XMMS_CMD_PRINT_ARG_BIN(a)   , argval##a
#define __XMMS_CMD_PRINT_ARG_LIST(a)   , argval##a
#define __XMMS_CMD_PRINT_ARG_DICT(a)   , argval##a
#define __XMMS_CMD_DO_RETVAL_NONE()   arg->retval = xmmsv_new_none();
#define __XMMS_CMD_DO_RETVAL_DICT()   arg->retval = xmms_convert_and_kill_dict
#define __XMMS_CMD_DO_RETVAL_INT32()   arg->retval = xmmsv_new_int
#define __XMMS_CMD_DO_RETVAL_LIST()   arg->retval = xmms_convert_and_kill_list
#define __XMMS_CMD_DO_RETVAL_STRING()   arg->retval = xmms_convert_and_kill_string
#define __XMMS_CMD_DO_RETVAL_COLL()   arg->retval = xmmsv_new_coll
#define __XMMS_CMD_DO_RETVAL_BIN()   arg->retval =
#define __XMMS_CMD_DO_RETTYPE_NONE()   void
#define __XMMS_CMD_DO_RETTYPE_STRING()   char *
#define __XMMS_CMD_DO_RETTYPE_INT32()   gint32
#define __XMMS_CMD_DO_RETTYPE_COLL(a)   xmmsv_coll_t *
#define __XMMS_CMD_DO_RETTYPE_BIN(a)   xmmsv_t *
#define __XMMS_CMD_DO_RETTYPE_LIST(a)   GList *
#define __XMMS_CMD_DO_RETTYPE_DICT(a)   GTree *
#define __XMMS_CMD_DO_ARGTYPE_NONE
#define __XMMS_CMD_DO_ARGTYPE_STRING   , const char *
#define __XMMS_CMD_DO_ARGTYPE_INT32   , gint32
#define __XMMS_CMD_DO_ARGTYPE_COLL   , xmmsv_coll_t *
#define __XMMS_CMD_DO_ARGTYPE_BIN   , GString *
#define __XMMS_CMD_DO_ARGTYPE_LIST   , xmmsv_t *
#define __XMMS_CMD_DO_ARGTYPE_DICT   , xmmsv_t *
#define XMMS_CMD_DEFINE6(cmdid, realfunc, argtype0, _rettype, argtype1, argtype2, argtype3, argtype4, argtype5, argtype6)
#define XMMS_CMD_DEFINE(cmdid, realfunc, argtype0, _rettype, argtype1, argtype2)   XMMS_CMD_DEFINE6(cmdid, realfunc, argtype0, _rettype, argtype1, argtype2, NONE, NONE, NONE, NONE)
#define XMMS_CMD_DEFINE3(cmdid, realfunc, argtype0, _rettype, argtype1, argtype2, argtype3)   XMMS_CMD_DEFINE6(cmdid, realfunc, argtype0, _rettype, argtype1, argtype2, argtype3, NONE, NONE, NONE)
#define XMMS_CMD_DEFINE4(cmdid, realfunc, argtype0, _rettype, argtype1, argtype2, argtype3, argtype4)   XMMS_CMD_DEFINE6(cmdid, realfunc, argtype0, _rettype, argtype1, argtype2, argtype3, argtype4, NONE, NONE)
#define XMMS_CMD_DEFINE5(cmdid, realfunc, argtype0, _rettype, argtype1, argtype2, argtype3, argtype4, argtype5)   XMMS_CMD_DEFINE6(cmdid, realfunc, argtype0, _rettype, argtype1, argtype2, argtype3, argtype4, argtype5, NONE)
#define XMMS_CMD_FUNC(cmdid)   &__int_xmms_cmd_desc_##cmdid
#define xmms_object_ref(obj)
#define xmms_object_unref(obj)
#define xmms_object_new(objtype, destroyfunc)   (objtype *) __int_xmms_object_new (sizeof (objtype), destroyfunc)

Typedefs

typedef struct xmms_object_St xmms_object_t
typedef struct
xmms_object_cmd_desc_St 
xmms_object_cmd_desc_t
typedef void(* xmms_object_destroy_func_t )(xmms_object_t *object)
typedef void(* xmms_object_handler_t )(xmms_object_t *object, xmmsv_t *data, gpointer userdata)
typedef void(* xmms_object_cmd_func_t )(xmms_object_t *object, xmms_object_cmd_arg_t *arg)

Functions

xmmsv_t * xmms_convert_and_kill_list (GList *list)
xmmsv_t * xmms_convert_and_kill_dict (GTree *dict)
xmmsv_t * xmms_convert_and_kill_string (gchar *str)
xmmsv_t * xmms_convert_and_kill_bin (GString *gs)
int xmms_bin_to_gstring (xmmsv_t *value, GString **gs)
int dummy_identity (xmmsv_t *value, xmmsv_t **arg)
gboolean check_string_list (xmmsv_t *list)
 Checks that the list only contains string values.
void xmms_object_cleanup (xmms_object_t *object)
 Cleanup all the resources for the object.
void xmms_object_connect (xmms_object_t *object, guint32 signalid, xmms_object_handler_t handler, gpointer userdata)
 Connect to a signal that is emitted by this object.
void xmms_object_disconnect (xmms_object_t *object, guint32 signalid, xmms_object_handler_t handler, gpointer userdata)
 Disconnect from a signal.
void xmms_object_emit (xmms_object_t *object, guint32 signalid, xmmsv_t *data)
 Emit a signal and thus call all the handlers that are connected.
void xmms_object_emit_f (xmms_object_t *object, guint32 signalid, xmmsv_type_t type,...)
 Emits a signal on the current object.
void xmms_object_cmd_arg_init (xmms_object_cmd_arg_t *arg)
 Initialize a command argument.
void xmms_object_cmd_add (xmms_object_t *object, guint cmdid, const xmms_object_cmd_desc_t *desc)
 Add a command that could be called from the client API to a object.
void xmms_object_cmd_call (xmms_object_t *object, guint cmdid, xmms_object_cmd_arg_t *arg)
 Call a command with argument.
void __int_xmms_object_unref (xmms_object_t *object)
xmms_object_t__int_xmms_object_new (gint size, xmms_object_destroy_func_t destfunc)

Define Documentation

#define __XMMS_CMD_DO_ARGTYPE_BIN   , GString *

Definition at line 152 of file xmms_object.h.

#define __XMMS_CMD_DO_ARGTYPE_COLL   , xmmsv_coll_t *

Definition at line 151 of file xmms_object.h.

#define __XMMS_CMD_DO_ARGTYPE_DICT   , xmmsv_t *

Definition at line 154 of file xmms_object.h.

#define __XMMS_CMD_DO_ARGTYPE_INT32   , gint32

Definition at line 150 of file xmms_object.h.

#define __XMMS_CMD_DO_ARGTYPE_LIST   , xmmsv_t *

Definition at line 153 of file xmms_object.h.

#define __XMMS_CMD_DO_ARGTYPE_NONE

Definition at line 148 of file xmms_object.h.

#define __XMMS_CMD_DO_ARGTYPE_STRING   , const char *

Definition at line 149 of file xmms_object.h.

#define __XMMS_CMD_DO_RETTYPE_BIN (  )     xmmsv_t *

Definition at line 144 of file xmms_object.h.

#define __XMMS_CMD_DO_RETTYPE_COLL (  )     xmmsv_coll_t *

Definition at line 143 of file xmms_object.h.

#define __XMMS_CMD_DO_RETTYPE_DICT (  )     GTree *

Definition at line 146 of file xmms_object.h.

 
#define __XMMS_CMD_DO_RETTYPE_INT32 (  )     gint32

Definition at line 142 of file xmms_object.h.

#define __XMMS_CMD_DO_RETTYPE_LIST (  )     GList *

Definition at line 145 of file xmms_object.h.

 
#define __XMMS_CMD_DO_RETTYPE_NONE (  )     void

Definition at line 140 of file xmms_object.h.

 
#define __XMMS_CMD_DO_RETTYPE_STRING (  )     char *

Definition at line 141 of file xmms_object.h.

 
#define __XMMS_CMD_DO_RETVAL_BIN (  )     arg->retval =

Definition at line 138 of file xmms_object.h.

 
#define __XMMS_CMD_DO_RETVAL_COLL (  )     arg->retval = xmmsv_new_coll

Definition at line 137 of file xmms_object.h.

 
#define __XMMS_CMD_DO_RETVAL_DICT (  )     arg->retval = xmms_convert_and_kill_dict

Definition at line 133 of file xmms_object.h.

 
#define __XMMS_CMD_DO_RETVAL_INT32 (  )     arg->retval = xmmsv_new_int

Definition at line 134 of file xmms_object.h.

 
#define __XMMS_CMD_DO_RETVAL_LIST (  )     arg->retval = xmms_convert_and_kill_list

Definition at line 135 of file xmms_object.h.

 
#define __XMMS_CMD_DO_RETVAL_NONE (  )     arg->retval = xmmsv_new_none();

Definition at line 132 of file xmms_object.h.

 
#define __XMMS_CMD_DO_RETVAL_STRING (  )     arg->retval = xmms_convert_and_kill_string

Definition at line 136 of file xmms_object.h.

#define __XMMS_CMD_INIT_ARG ( argn,
argtype,
argtypecode   )     __XMMS_CMD_INIT_ARG_FULL(argn, argtypecode, xmmsv_get_##argtype)

Definition at line 113 of file xmms_object.h.

#define __XMMS_CMD_INIT_ARG_BIN (  )     __XMMS_CMD_INIT_ARG_FULL(a, GString *, xmms_bin_to_gstring)

Definition at line 120 of file xmms_object.h.

#define __XMMS_CMD_INIT_ARG_COLL (  )     __XMMS_CMD_INIT_ARG(a, coll, xmmsv_coll_t *)

Definition at line 119 of file xmms_object.h.

#define __XMMS_CMD_INIT_ARG_DICT (  )     __XMMS_CMD_INIT_ARG_FULL(a, xmmsv_t *, dummy_identity)

Definition at line 122 of file xmms_object.h.

#define __XMMS_CMD_INIT_ARG_FULL ( argn,
argtypecode,
extract_func   ) 
Value:
argtypecode argval##argn; \
    g_return_if_fail (extract_func (arg->values[argn], &argval##argn));

Definition at line 109 of file xmms_object.h.

#define __XMMS_CMD_INIT_ARG_INT32 (  )     __XMMS_CMD_INIT_ARG(a, int, gint)

Definition at line 118 of file xmms_object.h.

#define __XMMS_CMD_INIT_ARG_LIST (  )     __XMMS_CMD_INIT_ARG_FULL(a, xmmsv_t *, dummy_identity)

Definition at line 121 of file xmms_object.h.

#define __XMMS_CMD_INIT_ARG_NONE (  ) 

Definition at line 116 of file xmms_object.h.

#define __XMMS_CMD_INIT_ARG_STRING (  )     __XMMS_CMD_INIT_ARG(a, string, const gchar *)

Definition at line 117 of file xmms_object.h.

#define __XMMS_CMD_PRINT_ARG_BIN (  )     , argval##a

Definition at line 128 of file xmms_object.h.

#define __XMMS_CMD_PRINT_ARG_COLL (  )     , argval##a

Definition at line 127 of file xmms_object.h.

#define __XMMS_CMD_PRINT_ARG_DICT (  )     , argval##a

Definition at line 130 of file xmms_object.h.

#define __XMMS_CMD_PRINT_ARG_INT32 (  )     , argval##a

Definition at line 126 of file xmms_object.h.

#define __XMMS_CMD_PRINT_ARG_LIST (  )     , argval##a

Definition at line 129 of file xmms_object.h.

#define __XMMS_CMD_PRINT_ARG_NONE (  ) 

Definition at line 124 of file xmms_object.h.

#define __XMMS_CMD_PRINT_ARG_STRING (  )     , argval##a

Definition at line 125 of file xmms_object.h.

#define XMMS_CMD_DEFINE ( cmdid,
realfunc,
argtype0,
_rettype,
argtype1,
argtype2   )     XMMS_CMD_DEFINE6(cmdid, realfunc, argtype0, _rettype, argtype1, argtype2, NONE, NONE, NONE, NONE)

Definition at line 176 of file xmms_object.h.

#define XMMS_CMD_DEFINE3 ( cmdid,
realfunc,
argtype0,
_rettype,
argtype1,
argtype2,
argtype3   )     XMMS_CMD_DEFINE6(cmdid, realfunc, argtype0, _rettype, argtype1, argtype2, argtype3, NONE, NONE, NONE)

Definition at line 177 of file xmms_object.h.

#define XMMS_CMD_DEFINE4 ( cmdid,
realfunc,
argtype0,
_rettype,
argtype1,
argtype2,
argtype3,
argtype4   )     XMMS_CMD_DEFINE6(cmdid, realfunc, argtype0, _rettype, argtype1, argtype2, argtype3, argtype4, NONE, NONE)

Definition at line 178 of file xmms_object.h.

#define XMMS_CMD_DEFINE5 ( cmdid,
realfunc,
argtype0,
_rettype,
argtype1,
argtype2,
argtype3,
argtype4,
argtype5   )     XMMS_CMD_DEFINE6(cmdid, realfunc, argtype0, _rettype, argtype1, argtype2, argtype3, argtype4, argtype5, NONE)

Definition at line 179 of file xmms_object.h.

#define XMMS_CMD_DEFINE6 ( cmdid,
realfunc,
argtype0,
_rettype,
argtype1,
argtype2,
argtype3,
argtype4,
argtype5,
argtype6   ) 
Value:
\
    static __XMMS_CMD_DO_RETTYPE_##_rettype() realfunc (argtype0 __XMMS_CMD_DO_ARGTYPE_##argtype1 __XMMS_CMD_DO_ARGTYPE_##argtype2 __XMMS_CMD_DO_ARGTYPE_##argtype3 __XMMS_CMD_DO_ARGTYPE_##argtype4 __XMMS_CMD_DO_ARGTYPE_##argtype5 __XMMS_CMD_DO_ARGTYPE_##argtype6, xmms_error_t *); \
\
static void \
__int_xmms_cmd_##cmdid (xmms_object_t *object, xmms_object_cmd_arg_t *arg) \
{ \
g_return_if_fail (XMMS_IS_OBJECT (object)); \
__XMMS_CMD_INIT_ARG_##argtype1 (0) \
__XMMS_CMD_INIT_ARG_##argtype2 (1) \
__XMMS_CMD_INIT_ARG_##argtype3 (2) \
__XMMS_CMD_INIT_ARG_##argtype4 (3) \
__XMMS_CMD_INIT_ARG_##argtype5 (4) \
__XMMS_CMD_INIT_ARG_##argtype6 (5) \
__XMMS_CMD_DO_RETVAL_##_rettype() (realfunc ((argtype0)object __XMMS_CMD_PRINT_ARG_##argtype1(0) __XMMS_CMD_PRINT_ARG_##argtype2(1) __XMMS_CMD_PRINT_ARG_##argtype3(2) __XMMS_CMD_PRINT_ARG_##argtype4(3) __XMMS_CMD_PRINT_ARG_##argtype5(4) __XMMS_CMD_PRINT_ARG_##argtype6(5), &arg->error)); \
} \
static const xmms_object_cmd_desc_t __int_xmms_cmd_desc_##cmdid = { __int_xmms_cmd_##cmdid, XMMSV_TYPE_##_rettype, {XMMSV_TYPE_##argtype1, XMMSV_TYPE_##argtype2, XMMSV_TYPE_##argtype3, XMMSV_TYPE_##argtype4, XMMSV_TYPE_##argtype5, XMMSV_TYPE_##argtype6} }

Definition at line 157 of file xmms_object.h.

#define XMMS_CMD_FUNC ( cmdid   )     &__int_xmms_cmd_desc_##cmdid

Definition at line 181 of file xmms_object.h.

#define XMMS_IS_OBJECT (  )     (XMMS_OBJECT (p)->id == XMMS_OBJECT_MID)
#define XMMS_OBJECT (  )     ((xmms_object_t *)p)
#define XMMS_OBJECT_CMD_MAX_ARGS   6

Definition at line 69 of file xmms_object.h.

#define XMMS_OBJECT_MID   0x00455574

Definition at line 29 of file xmms_object.h.

Referenced by __int_xmms_object_new().

#define xmms_object_new ( objtype,
destroyfunc   )     (objtype *) __int_xmms_object_new (sizeof (objtype), destroyfunc)
#define xmms_object_ref ( obj   ) 
Value:
do { \
    if (obj && XMMS_IS_OBJECT (obj)) { \
        g_atomic_int_inc (&(XMMS_OBJECT (obj)->ref)); \
    } \
} while (0)

Definition at line 187 of file xmms_object.h.

Referenced by __int_xmms_object_new(), _xmms_medialib_begin(), xmms_visualization_new(), xmms_xform_new(), xmms_xform_outdata_type_copy(), and xmms_xform_outdata_type_set().

#define xmms_object_unref ( obj   ) 

Typedef Documentation

Definition at line 35 of file xmms_object.h.

Definition at line 76 of file xmms_object.h.

typedef void(* xmms_object_destroy_func_t)(xmms_object_t *object)

Definition at line 37 of file xmms_object.h.

typedef void(* xmms_object_handler_t)(xmms_object_t *object, xmmsv_t *data, gpointer userdata)

Definition at line 67 of file xmms_object.h.

typedef struct xmms_object_St xmms_object_t

Definition at line 34 of file xmms_object.h.


Function Documentation

xmms_object_t* __int_xmms_object_new ( gint  size,
xmms_object_destroy_func_t  destfunc 
)

Definition at line 501 of file object.c.

void __int_xmms_object_unref ( xmms_object_t object  ) 

Definition at line 489 of file object.c.


Generated on Tue Feb 23 18:14:36 2010 for XMMS2 by  doxygen 1.6.1