int error = RequirePlugin(lua_State *L, int version, int revision,
ULONG flags, struct hwTagList *tags);
@REQUIRE preprocessor command
on the plugin. It is especially useful to initialize plugins that are not automatically
set up when Hollywood starts. You will typically initialize these plugin types from
your RequirePlugin() function then. See Auto and manual plugin initialization for details.
RequirePlugin() can also be used to perform some custom initialization or configuration
according to the user's specific needs as it is possible to pass parameters from the
@REQUIRE preprocessor statement to your RequirePlugin() implementation through
the HWRPTAG_USERTAGS tag item (see below).
Here is a list of tags supported by this function:
HWRPTAG_USERTAGS:struct hwUserTagList containing a
list of all parameters the user has passed to the @REQUIRE preprocessor command.
The struct hwUserTagList looks like this:
struct hwUserTagList
{
struct hwUserTagList *Succ;
STRPTR Name;
STRPTR Str;
double Val;
};
|
Here is a description of the structure members:
Succ:NULL for the tail node.
Name:
Str:NULL, then you have to examine the Val member below.
Val:See User tags for details.
HWRPTAG_PLUGINFLAGS:ULONG variable here which you can write to if your plugin wants
to request certain features. The following flags are currently recognized:
HWPLUGINFLAGS_HIDEDISPLAYS:
HWPLUGINFLAGS_SCALEDISPLAYS:SystemScale tag to True for
all displays. (V8.0)
HWPLUGINFLAGS_INTERPOLATE:HWPLUGINFLAGS_SCALEDISPLAYS is set and the current monitor's density
setting requires scaling, setting HWPLUGINFLAGS_INTERPOLATE will use bilinear
interpolation when scaling. (V8.0)
Note that if you want your plugin to be compatible with Hollywood Designer
you need to set the HWEXT_REQUIRE_LUALESS extension and make sure your
implementation of RequirePlugin() doesn't crash when a NULL pointer is passed
in the L argument. Since Designer doesn't contain a Lua virtual machine,
it won't be able to pass a lua_State pointer to RequirePlugin().
That is why by default, Designer ignores plugins which depend on RequirePlugin() to be called.
However, if you set HWEXT_REQUIRE_LUALESS and then make sure that your
RequirePlugin() implementation can handle a NULL pointer in the lua_State argument,
your plugin will be compatible with Designer as well. See GetExtensions for details.
lua_State@REQUIRE call@REQUIRE callNULL (see above)