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

Go to the source code of this file.

Data Structures

struct  plugDefinition

Macros

#define IW_GRAB_TYPES
#define PLUG_ABI_VERSION   2
#define ICEMM_VERSION   1

Typedefs

typedef struct _plugPlugin plugPlugin
typedef struct plugDefinition plugDefinition
typedef plugDefinition *(* plugGetInfoFunc )(int call_cnt, BOOL *append)

Enumerations

enum  plugPageFlags { PLUG_PAGE_NOPLUG = 1 << 0, PLUG_PAGE_NODISABLE = 1 << 1 }

Functions

plugPluginplug_get_by_name (const char *name)
plugDefinitionplug_def_get_by_name (const char *name)
char * plug_get_datadir (plugDefinition *plug)
char * plug_name (plugDefinition *plug, const char *suffix)
void plug_set_enable (plugPlugin *plug, BOOL enabled)
BOOL plug_register (plugDefinition *plug, plugDefinition *plug_new, BOOL append, int argc, char **argv)
int plug_add_default_page (plugDefinition *plugDef, const char *suffix, plugPageFlags flags)

Macro Definition Documentation

#define IW_GRAB_TYPES
#define PLUG_ABI_VERSION   2

plugDefinition->abi_version should be set to this value in the plug_get_info() factory function of a plugin.

#define ICEMM_VERSION   1

For C++ plugins, this is the provided version. This can also be used to test whether icemm support is available at all.


Typedef Documentation

typedef struct _plugPlugin plugPlugin

Definition of a plugin instance. Must be returned by the plug_get_info() factory function of a plugin.

typedef plugDefinition*(* plugGetInfoFunc)(int call_cnt, BOOL *append)

Called on load of the plugin. Returns the filled plugin definition structure and whether the plugin should be inserted at the start or at the end of the iceWing internal plugin list.


Enumeration Type Documentation

Customizing flags for plug_add_default_page()

Enumerator:
PLUG_PAGE_NOPLUG 
PLUG_PAGE_NODISABLE 

Function Documentation

plugPlugin* plug_get_by_name ( const char *  name)

  Return the plugin whose name matches 'name'.

plugDefinition* plug_def_get_by_name ( const char *  name)
char* plug_get_datadir ( plugDefinition plug)

  Return the path where 'plug' can store it's data files.

char* plug_name ( plugDefinition plug,
const char *  suffix 
)

  Return a pointer to a per-plugin-instance string of the form
  'plugDef->name''suffix'. Can be used e.g. for preview windows and
  option pages.

void plug_set_enable ( plugPlugin plug,
BOOL  enabled 
)

  Set the plugin enabled state.

BOOL plug_register ( plugDefinition plug,
plugDefinition plug_new,
BOOL  append,
int  argc,
char **  argv 
)

  Register a new plugin 'plug_new' with iceWing. The new plugin gets
  associated with the plugin 'plug', which should be the calling
  plugin. Initialization is scheduled before the next main loop run.
  append    : Should the new plugin be inserted at the start or at
              the end of the iceWing internal plugin list.
  argc, argv: Command line arguments for the new plugin.
  Return TRUE on sucess, FALSE otherwise.

  Attention: The function is not thread save. Should only be used for
            language bindings. No arguments are copied.

int plug_add_default_page ( plugDefinition plugDef,
const char *  suffix,
plugPageFlags  flags 
)

  Create a new option page with the name 'plugDef->name" "suffix' and
  two widgets:
    1. Toggle to enable/disable the plugin processing call
      (only if PLUG_PAGE_NODISABLE is not set in flags).
    2. String for plugin names (only if PLUG_PAGE_NOPLUG is not set in
      flags). The plugin gets called one after another for all data
      from plugins which are entered here.
  Return the number of the newly created page.