iceWing
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
Data Structures | Macros | Typedefs | Functions
plugin_comm.h File Reference
#include "plugin.h"

Go to the source code of this file.

Data Structures

struct  plugData
struct  plugDataFunc

Macros

#define PLUG_PRIORITY_DEFAULT   (-1)
#define PLUG_PRIORITY_MIN   0
#define PLUG_PRIORITY_MAX   1000

Typedefs

typedef void(* plugDataDestroyFunc )(void *data)
typedef void(* plugFunc )()
typedef struct plugData plugData
typedef struct plugDataFunc plugDataFunc

Functions

void plug_data_set (plugDefinition *plug, const char *ident, void *data, plugDataDestroyFunc destroy)
void plug_data_sink (plugData *data)
plugDataplug_data_get (const char *ident, plugData *data)
plugDataplug_data_get_new (const char *ident, plugData *data)
plugDataplug_data_get_full (const char *ident, plugData *data, BOOL onlynew, const char *plug_name)
void plug_data_ref (plugData *data)
void plug_data_unget (plugData *data)
BOOL plug_data_is_observed (const char *ident)
void plug_observ_data (plugDefinition *plug, const char *ident)
void plug_observ_data_priority (plugDefinition *plug, const char *ident, int pri)
void plug_observ_data_remove (plugDefinition *plug, const char *ident)
void plug_function_register (plugDefinition *plug, const char *ident, plugFunc func)
void plug_function_unregister (plugDefinition *plug, const char *ident)
plugDataFuncplug_function_get (const char *ident, plugDataFunc *func)
plugDataFuncplug_function_get_full (const char *ident, plugDataFunc *func, const char *plug_name)

Macro Definition Documentation

#define PLUG_PRIORITY_DEFAULT   (-1)

Use default priority values

#define PLUG_PRIORITY_MIN   0

Always at end of list

#define PLUG_PRIORITY_MAX   1000

Always at start of list


Typedef Documentation

typedef void(* plugDataDestroyFunc)(void *data)

Called if data stored with plug_data_set() should be released

typedef void(* plugFunc)()
typedef struct plugData plugData

Stored data, see e.g. plug_data_get().

typedef struct plugDataFunc plugDataFunc

Stored function, see e.g. plug_function_get()


Function Documentation

void plug_data_set ( plugDefinition plug,
const char *  ident,
void *  data,
plugDataDestroyFunc  destroy 
)

  Store refcounted data under the ID ident. plug is the plugin from
  where this function is called.
  destroy is called if the refcount drops to 0.

void plug_data_sink ( plugData data)

  By default, even if refcount of data drops to 0, it is deleted not
  until the end of the current mainloop run. This changes it to delete
  data immediately if refcount drops to 0. If unsure, don't use it.

plugData* plug_data_get ( const char *  ident,
plugData data 
)

  Retrieve data stored under the ID 'ident'.
  The refcount of 'data' is increased.
  data    : If != NULL the data stored after 'data' under 'ident'
            is returned, otherwise the first data element with an
            ID of 'ident.
  _new() / onlynew: Get only data which was added after the
            last restart of the mainloop.
  plug_name: Get data stored by a plugin by this name.

plugData* plug_data_get_new ( const char *  ident,
plugData data 
)
plugData* plug_data_get_full ( const char *  ident,
plugData data,
BOOL  onlynew,
const char *  plug_name 
)
void plug_data_ref ( plugData data)

  Increase the refcount of 'data'. plug_data_unget() must be called
  to drop the refcount.

Referenced by ICEWING::PluginData::operator=(), and ICEWING::PluginData::PluginData().

void plug_data_unget ( plugData data)

  Drop refcount of data.

Referenced by ICEWING::PluginData::operator=(), and ICEWING::PluginData::~PluginData().

BOOL plug_data_is_observed ( const char *  ident)

  Returns TRUE if there is a plugin which observes 'ident'.

void plug_observ_data ( plugDefinition plug,
const char *  ident 
)

  Add an observer for data with the ID 'ident'. plug is the plugin
  from where this function is called. The plugin's proces() function
  will be called if data with the ID 'ident' is available.
  ident == "id"      : Add the observer.
  ident == "id()"    : Add the observer. The proces() function is
        called one after another for all available data elements
        (see plug_add_default_page()).
  ident == "id(plugs)": Add the observer. The proces() function is
        additionally called for data elements from the plugins
        "plugs" (see plug_add_default_page()).

void plug_observ_data_priority ( plugDefinition plug,
const char *  ident,
int  pri 
)
void plug_observ_data_remove ( plugDefinition plug,
const char *  ident 
)

  Remove an observer set with plug_observ_data().
  ident == "id"      : Remove the observer.
  ident == "id()"    : Remove the observer and any dependent plugins
        in the plugin names string (see plug_add_default_page()).
  ident == "id(plugs)": Remove the specified plugins from the plugin
        names string (see plug_add_default_page()) and the observer,
        if no dependent plugins in the plugin names string are left.

void plug_function_register ( plugDefinition plug,
const char *  ident,
plugFunc  func 
)

  Register a function under the ID 'ident'. plug is the plugin from
  where this function is called.

void plug_function_unregister ( plugDefinition plug,
const char *  ident 
)

  Unregister a function registered with plug_function_register().

plugDataFunc* plug_function_get ( const char *  ident,
plugDataFunc func 
)

  Get function stored under the ID 'ident'. If 'func'!=NULL the
  function stored after 'func' under 'ident' is returned.

  plug_name: Get function stored by a plugin by this name.

plugDataFunc* plug_function_get_full ( const char *  ident,
plugDataFunc func,
const char *  plug_name 
)