libvisual  0.5.0
Namespaces | Macros | Typedefs | Functions
VisParam
Collaboration diagram for VisParam:

Namespaces

namespace  LV
 Libvisual namespace.
 

Macros

#define VISUAL_PARAM(obj)   ((VisParam *) (obj))
 
#define VISUAL_PARAM_LIST(obj)   ((VisParamList *) (obj))
 
#define _LV_DEFINE_PARAM_NEW(func, ctype, type, marshal)
 

Typedefs

typedef LV::Param VisParam
 
typedef LV::ParamList VisParamList
 
typedef int(* VisParamValidateFunc )(VisParamValue *value, void *priv)
 
typedef void(* VisParamChangedFunc )(VisParam *param, void *priv)
 
typedef void(* VisDestroyFunc )(void *data)
 

Functions

VisClosure * visual_closure_new (void *func, void *data, VisDestroyFunc destroy_func)
 
void visual_closure_free (VisClosure *self)
 
VisParamListvisual_param_list_new (void)
 
void visual_param_list_free (VisParamList *self)
 
void visual_param_list_add (VisParamList *list, VisParam *param)
 
void visual_param_list_add_array (VisParamList *list, VisParam **params, unsigned int nparams)
 
void visual_param_list_add_many (VisParamList *list,...)
 
VisParam ** visual_param_list_get_entries (VisParamList *list)
 
int visual_param_list_remove (VisParamList *list, const char *name)
 
VisParam * visual_param_list_get (VisParamList *list, const char *name)
 
void visual_param_list_set_event_queue (VisParamList *list, VisEventQueue *eventqueue)
 
VisEventQueuevisual_param_list_get_event_queue (VisParamList *list)
 
VisParam * visual_param_new (const char *name, const char *description, VisParamType type, void *default_value, VisClosure *validator)
 Creates a new parameter entry. More...
 
void visual_param_free (VisParam *param)
 Frees a parameter entry. More...
 
VisClosure * visual_param_add_callback (VisParam *param, VisParamChangedFunc func, void *data, VisDestroyFunc destroy_func)
 Adds a change notification callback. More...
 
int visual_param_remove_callback (VisParam *param, VisClosure *closure)
 Removes a change notification callback. More...
 
void visual_param_notify_callbacks (VisParam *param)
 Notifies all callbacks. More...
 
void visual_param_changed (VisParam *param)
 Emits an event in the eventqueue of the parent VisParamList. More...
 
int visual_param_has_name (VisParam *param, const char *name)
 Determines if the VisParam is of a given name. More...
 
const char * visual_param_get_name (VisParam *param)
 
VisParamType visual_param_get_type (VisParam *param)
 
const char * visual_param_get_description (VisParam *param)
 
void visual_param_set_value (VisParam *param, VisParamValue *value)
 
void visual_param_set_value_bool (VisParam *param, int boolean)
 
void visual_param_set_value_integer (VisParam *param, int integer)
 
void visual_param_set_value_float (VisParam *param, float flt)
 
void visual_param_set_value_double (VisParam *param, double dbl)
 
void visual_param_set_value_string (VisParam *param, const char *string)
 
void visual_param_set_value_color (VisParam *param, VisColor *color)
 
void visual_param_set_value_palette (VisParam *param, VisPalette *pal)
 
int visual_param_get_value_bool (VisParam *param)
 
int visual_param_get_value_integer (VisParam *param)
 
float visual_param_get_value_float (VisParam *param)
 
double visual_param_get_value_double (VisParam *param)
 
const char * visual_param_get_value_string (VisParam *param)
 
VisColorvisual_param_get_value_color (VisParam *param)
 
VisPalettevisual_param_get_value_palette (VisParam *param)
 

Detailed Description

Macro Definition Documentation

#define _LV_DEFINE_PARAM_NEW (   func,
  ctype,
  type,
  marshal 
)
Value:
static inline VisParam *visual_param_new_##func (const char *name, \
const char *description, \
ctype default_value, \
VisClosure *validator) \
{ return visual_param_new (name, description, VISUAL_PARAM_TYPE_##type, _LV_PARAM_MARSHAL_##marshal (default_value), validator); }

Definition at line 276 of file lv_param.h.

Function Documentation

VisClosure* visual_param_add_callback ( VisParam *  param,
VisParamChangedFunc  func,
void *  data,
VisDestroyFunc  destroy_func 
)

Adds a change notification callback.

Parameters
paramVisParam object to add notification callback
funcThe notification callback, called on value changes
dataAdditional data to be passed to callback
destroy_funcFunction called to destroy data (may be NULL)
void visual_param_changed ( VisParam *  param)

Emits an event in the eventqueue of the parent VisParamList.

Parameters
paramVisParam object that has changed.
void visual_param_free ( VisParam *  param)

Frees a parameter entry.

Parameters
paramParam to free

Definition at line 414 of file lv_param.cpp.

int visual_param_has_name ( VisParam *  param,
const char *  name 
)

Determines if the VisParam is of a given name.

Parameters
paramVisParam object
nameName to check against
Returns
TRUE if name matches, FALSE otherwise

Definition at line 419 of file lv_param.cpp.

VisParam* visual_param_new ( const char *  name,
const char *  description,
VisParamType  type,
void *  default_value,
VisClosure *  validator 
)

Creates a new parameter entry.

Parameters
nameName
typeType
descriptionDescription
default_valueDefault Value
validatorValidator function (closure)
Returns
A newly allocated VisParam

Definition at line 400 of file lv_param.cpp.

void visual_param_notify_callbacks ( VisParam *  param)

Notifies all callbacks.

Parameters
paramVisParam object
int visual_param_remove_callback ( VisParam *  param,
VisClosure *  closure 
)

Removes a change notification callback.

Parameters
paramVisParam object to remove callback from
closureThe closure pointer that was given by the visual_param_add_callback().
Returns
TRUE on successful removal, FALSE otherwise