libvisual  0.5.0
Namespaces | Classes | Macros | Typedefs | Enumerations | Functions
VisPlugin
Collaboration diagram for VisPlugin:

Namespaces

namespace  LV
 Libvisual namespace.
 

Classes

struct  VisPluginInfo
 The VisPluginInfo data structure contains information about a plugin and is filled within the plugin itself. More...
 

Macros

#define VISUAL_PLUGIN_API_VERSION   3005
 Compile-time macro indicating the Plugin API version.
 
#define VISUAL_PLUGIN_LICENSE_GPLv1   "GPLv1"
 
#define VISUAL_PLUGIN_LICENSE_GPL   "GPLv2"
 
#define VISUAL_PLUGIN_LICENSE_GPLv3   "GPLv3"
 
#define VISUAL_PLUGIN_LICENSE_LGPL   "LGPL"
 
#define VISUAL_PLUGIN_LICENSE_BSD   "BSD"
 
#define VISUAL_PLUGIN_VERSION_TAG   "__lv_plugin_libvisual_api_version"
 
#define VISUAL_PLUGIN_API_VERSION_VALIDATOR
 

Typedefs

typedef LV::PluginData VisPluginData
 
typedef struct _VisPluginRef VisPluginRef
 
typedef int(* VisPluginInitFunc )(VisPluginData *plugin)
 Function signature and type for the Plugin init() method. More...
 
typedef void(* VisPluginCleanupFunc )(VisPluginData *plugin)
 Function signature and tpye for the Plugin cleanup() method. More...
 
typedef int(* VisPluginEventsFunc )(VisPluginData *plugin, VisEventQueue *events)
 Function signature and type for the Plugin events() method. More...
 

Enumerations

enum  VisPluginFlags { VISUAL_PLUGIN_FLAG_NONE = 0, VISUAL_PLUGIN_FLAG_REENTRANT = 1 }
 Plugin flags. More...
 
enum  VisPluginType { VISUAL_PLUGIN_TYPE_ACTOR, VISUAL_PLUGIN_TYPE_INPUT, VISUAL_PLUGIN_TYPE_MORPH }
 Plugin type.
 

Functions

int visual_plugin_get_api_version (void)
 Returns the version of the Plugin API. More...
 
VisEventQueuevisual_plugin_get_event_queue (VisPluginData *plugin)
 Returns a Plugin's event queue. More...
 
void visual_plugin_events_pump (VisPluginData *plugin)
 Pumps all queued events to a Plugin for handling. More...
 
const VisPluginInfo * visual_plugin_get_info (VisPluginData *plugin)
 Returns information on a Plugin. More...
 
void * visual_plugin_get_specific (VisPluginData *plugin)
 Retrieves the type-specific information and state of a Plugin. More...
 
VisParamListvisual_plugin_get_params (VisPluginData *plugin)
 Returns the parameter list of a Plugin. More...
 
VisRandomContextvisual_plugin_get_random_context (VisPluginData *plugin)
 Returns the random number generator assigned to a Plugin. More...
 
void visual_plugin_set_private (VisPluginData *plugin, void *priv)
 Attaches a data pointer to a Plugin. More...
 
void * visual_plugin_get_private (VisPluginData *plugin)
 Returns the private Plugin data pointer set with visual_plugin_set_private(). More...
 
VisPluginData * visual_plugin_load (VisPluginType type, const char *name)
 Loads a Plugin. More...
 
void visual_plugin_unload (VisPluginData *plugin)
 Unloads a Plugin. More...
 
int visual_plugin_realize (VisPluginData *plugin)
 Realizes a Plugin. More...
 
int visual_plugin_is_realized (VisPluginData *plugin)
 Determines if a Plugin has been realised. More...
 

Detailed Description

Macro Definition Documentation

#define VISUAL_PLUGIN_API_VERSION_VALIDATOR
Value:
LV_C_LINKAGE LV_PLUGIN_EXPORT const int __lv_plugin_libvisual_api_version = VISUAL_PLUGIN_API_VERSION; \
LV_C_LINKAGE LV_PLUGIN_EXPORT const VisPluginInfo* get_plugin_info (void);

Definition at line 46 of file lv_plugin.h.

Typedef Documentation

typedef void(* VisPluginCleanupFunc)(VisPluginData *plugin)

Function signature and tpye for the Plugin cleanup() method.

The cleanup() method is called to clean up the plugin state and free any allocated resources.

Parameters
pluginPlugin object

Definition at line 103 of file lv_plugin.h.

typedef int(* VisPluginEventsFunc)(VisPluginData *plugin, VisEventQueue *events)

Function signature and type for the Plugin events() method.

The events() method is called to process events.

  • plugin Plugin object
  • events Event queue
Returns
TRUE on success, FALSE on failure

Definition at line 115 of file lv_plugin.h.

typedef int(* VisPluginInitFunc)(VisPluginData *plugin)

Function signature and type for the Plugin init() method.

The init() method is called to initialise the plugin state and pre-allocate needed resources for the Plugin to run.

Parameters
pluginPlugin object
Returns
TRUE on success, FALSE on failure

Definition at line 94 of file lv_plugin.h.

Enumeration Type Documentation

Plugin flags.

Enumerator
VISUAL_PLUGIN_FLAG_NONE 

Used to indicate the absence of special flags.

VISUAL_PLUGIN_FLAG_REENTRANT 

Indicate that plugin is safe for multiple instantiation.

Definition at line 51 of file lv_plugin.h.

Function Documentation

void visual_plugin_events_pump ( VisPluginData *  plugin)

Pumps all queued events to a Plugin for handling.

Parameters
pluginPlugin object

Definition at line 90 of file lv_plugin.cpp.

Referenced by LV::Actor::run().

int visual_plugin_get_api_version ( void  )

Returns the version of the Plugin API.

Returns
Plugin API version

Definition at line 217 of file lv_plugin.cpp.

VisEventQueue* visual_plugin_get_event_queue ( VisPluginData *  plugin)

Returns a Plugin's event queue.

See Also
visual_plugin_events_pump
Parameters
pluginPlugin object
Returns
Event queue

Definition at line 99 of file lv_plugin.cpp.

Referenced by LV::Actor::run(), and LV::Actor::video_negotiate().

const VisPluginInfo* visual_plugin_get_info ( VisPluginData *  plugin)

Returns information on a Plugin.

Parameters
pluginPlugin object
Returns
Information

Definition at line 106 of file lv_plugin.cpp.

Referenced by visual_plugin_get_specific().

VisParamList* visual_plugin_get_params ( VisPluginData *  plugin)

Returns the parameter list of a Plugin.

Parameters
pluginPlugin object
Returns
Parameter list, or NULL if none

Definition at line 113 of file lv_plugin.cpp.

Referenced by visual_plugin_realize().

void* visual_plugin_get_private ( VisPluginData *  plugin)

Returns the private Plugin data pointer set with visual_plugin_set_private().

Parameters
pluginPlugin object
Returns
Data pointer

Definition at line 210 of file lv_plugin.cpp.

VisRandomContext* visual_plugin_get_random_context ( VisPluginData *  plugin)

Returns the random number generator assigned to a Plugin.

Parameters
pluginPlugin object
Returns
Random number generator

Definition at line 120 of file lv_plugin.cpp.

void* visual_plugin_get_specific ( VisPluginData *  plugin)

Retrieves the type-specific information and state of a Plugin.

Parameters
pluginPlugin object
Returns
Type-specific data

Definition at line 127 of file lv_plugin.cpp.

int visual_plugin_is_realized ( VisPluginData *  plugin)

Determines if a Plugin has been realised.

See Also
visual_plugin_realize()
Parameters
pluginPlugin object
Returns
TRUE if plugin has been realised, FALSE otherwise

Definition at line 196 of file lv_plugin.cpp.

VisPluginData* visual_plugin_load ( VisPluginType  type,
const char *  name 
)

Loads a Plugin.

Note
The loaded plugin will need to be initialised with visual_plugin_realize().
See Also
visual_plugin_unload()
Parameters
typePlugin type
namePlugin name
Returns
A newly loaded Plugin

Definition at line 158 of file lv_plugin.cpp.

int visual_plugin_realize ( VisPluginData *  plugin)

Realizes a Plugin.

Calling this function will initialise the plugin for running.

Parameters
pluginPlugin object
Returns
TRUE on success, FALSE otherwise

Definition at line 173 of file lv_plugin.cpp.

Referenced by LV::Input::realize(), LV::Actor::realize(), and LV::Morph::realize().

void visual_plugin_set_private ( VisPluginData *  plugin,
void *  priv 
)

Attaches a data pointer to a Plugin.

Note
The caller is expected to free the data.
See Also
visual_plugin_get_private()
Parameters
pluginPlugin object
privData pointer
Returns
Data pointer

Definition at line 203 of file lv_plugin.cpp.

void visual_plugin_unload ( VisPluginData *  plugin)

Unloads a Plugin.

Parameters
pluginPlugin to unload

Definition at line 147 of file lv_plugin.cpp.