2.5 Auto and manual init plugins

All available plugins will be loaded automatically by Hollywood upon startup. However, not all plugins will be initialized automatically. Some plugin types will only be initialized if the user explicitly calls @REQUIRE on them. The reason for this is simple: Some plugin types can completely replace core components of Hollywood like the inbuilt display or audio driver. It would not make any sense to activate these plugins automatically upon startup because it could happen then that several plugins try to replace the same core component and it would also make it impossible to revert to Hollywood's inbuilt drivers. That's the reason why certain plugin types are only initialized if explicitly demanded by the user by calling @REQUIRE on them. Other plugin types, however, like loaders and savers for additional file formats are normally initialized automatically so that they are immediately available to all Hollywood applications right after their installation. Starting with Hollywood 6.0 it is possible to prevent automatic initialization of image, animation, sound, and video loader plugins using extension flags.

If you want to write a plugin that requires manual initialization, you need to set the HWPLUG_CAPS_REQUIRE capability flag in your InitPlugin() implementation. Hollywood will then call your plugin whenever the user runs the @REQUIRE preprocessor command on your plugin. You will then be able to perform all necessary initialization in your implementation of the RequirePlugin() call.

Here's a brief overview which plugin types are automatically initialized and which plugin types have to be manually initialized from your RequirePlugin() function:

HWPLUG_CAPS_CONVERT
Initialized automatically when plugin is loaded.

HWPLUG_CAPS_LIBRARY
Initialized automatically when plugin is loaded. Starting with Hollywood 6.1 automatic loading can be disabled by setting the HWEXT_LIBRARY_NOAUTOINIT extension bit.

HWPLUG_CAPS_IMAGE
Initialized automatically when plugin is loaded. Starting with Hollywood 6.0 automatic loading can be disabled by setting the HWEXT_IMAGE_NOAUTOINIT extension bit.

HWPLUG_CAPS_ANIM
Initialized automatically when plugin is loaded. Starting with Hollywood 6.0 automatic loading can be disabled by setting the HWEXT_ANIM_NOAUTOINIT extension bit.

HWPLUG_CAPS_SOUND
Initialized automatically when plugin is loaded. Starting with Hollywood 6.0 automatic loading can be disabled by setting the HWEXT_SOUND_NOAUTOINIT extension bit.

HWPLUG_CAPS_VECTOR
Initialized automatically when plugin is loaded. Starting with Hollywood 6.0, however, the user will have to call SetVectorEngine() manually to make Hollywood's vectorgraphics library use the plugin.

HWPLUG_CAPS_VIDEO
Initialized automatically when plugin is loaded. Starting with Hollywood 6.0 automatic loading can be disabled by setting the HWEXT_VIDEO_NOAUTOINIT extension bit.

HWPLUG_CAPS_SAVEIMAGE
Initialized automatically when plugin is loaded.

HWPLUG_CAPS_SAVEANIM
Initialized automatically when plugin is loaded.

HWPLUG_CAPS_SAVESAMPLE
Initialized automatically when plugin is loaded.

HWPLUG_CAPS_REQUIRE
Initialized automatically when plugin is loaded.

HWPLUG_CAPS_DISPLAYADAPTER
Use hw_SetDisplayAdapter() to initialize this plugin type. See hw_SetDisplayAdapter for details.

HWPLUG_CAPS_TIMERADAPTER
Use hw_SetTimerAdapter() to initialize this plugin type. See hw_SetTimerAdapter for details.

HWPLUG_CAPS_REQUESTERADAPTER
Use hw_SetRequesterAdapter() to initialize this plugin type. See hw_SetRequesterAdapter for details.

HWPLUG_CAPS_FILEADAPTER
Use hw_AddLoaderAdapter() to initialize this plugin type. See hw_AddLoaderAdapter for details.

HWPLUG_CAPS_DIRADAPTER
Use hw_AddLoaderAdapter() to initialize this plugin type. See hw_AddLoaderAdapter for details.

HWPLUG_CAPS_AUDIOADAPTER
Use hw_SetAudioAdapter() to initialize this plugin type. See hw_SetAudioAdapter for details.

HWPLUG_CAPS_EXTENSION
This is a special plugin type that extends other plugin types. It does not offer any functionality on its own.

HWPLUG_CAPS_NETWORKADAPTER
Use hw_AddLoaderAdapter() to initialize this plugin type. See hw_AddLoaderAdapter for details.

HWPLUG_CAPS_SERIALIZE
Initialized automatically when plugin is loaded.

HWPLUG_CAPS_ICON
Initialized automatically when plugin is loaded. Automatic loading can be disabled by setting the HWEXT_ICON_NOAUTOINIT extension bit.

HWPLUG_CAPS_SAVEICON
Initialized automatically when plugin is loaded.

HWPLUG_CAPS_IPCADAPTER
Use hw_SetIPCAdapter() to initialize this plugin type. See hw_SetIPCAdapter for details.

HWPLUG_CAPS_FONT
Initialized automatically when plugin is loaded. Automatic loading can be disabled by setting the HWEXT_FONT_NOAUTOINIT extension bit.

HWPLUG_CAPS_FILESYSADAPTER
Use hw_AddLoaderAdapter() to initialize this plugin type. See hw_AddLoaderAdapter for details.

You will normally call the functions listed above in your RequirePlugin() implementation. See RequirePlugin for details.

Some plugin types only support the initialization of a single plugin, e.g. it is not possible to have multiple display adapter plugins running. Only a single display adapter can be active at a time. Thus, only the first call to hw_SetDisplayAdapter() will succeed. All other attempts to install another display adapter will fail once a plugin has installed a custom display adapter.


Show TOC