RequirePlugin -- require a plugin (V6.0)
int error = RequirePlugin(lua_State *L, int version, int revision,
                ULONG flags, struct hwTagList *tags);
This function will be called when the user runs the @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:

Hollywood will set this tag to a 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:

Contains a pointer to the next node in the list or NULL for the tail node.

Name of the parameter.

If the user has set the parameter to a string value, it is passed here. If this is NULL, then you have to examine the Val member below.

If the user has set the parameter to a numerical value, it is passed in this structure member.

See User tags for details.

This tag is used to return plugin flags back to Hollywood. Hollywood will pass a pointer to a ULONG variable here which you can write to if your plugin wants to request certain features. The following flags are currently recognized:

If you set this flag, Hollywood will hide all displays upon startup. Even the ones that have been explicitly declared as open will be hidden if this tag is set.

If you set this flag, Hollywood will apply system scaling to all displays, i.e. this flag will do the same as setting the SystemScale tag to True for all displays. (V8.0)

If 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.

pointer to the lua_State
plugin version requested in @REQUIRE call
plugin revision requested in @REQUIRE call
currently unused, will be 0
pointer to a taglist or NULL (see above)
error code or 0 for success

Show TOC