int error = hw_AddLoaderAdapter(hwPluginBase *self, ULONG type);
HWPLUG_CAPS_IMAGE:
hw_AddLoaderAdapter()
on them if automatic initialization
has been disabled by setting the HWEXT_IMAGE_NOAUTOINIT
extension bit.
HWPLUG_CAPS_ANIM:
hw_AddLoaderAdapter()
on them if automatic initialization
has been disabled by setting the HWEXT_ANIM_NOAUTOINIT
extension bit.
HWPLUG_CAPS_SOUND:
hw_AddLoaderAdapter()
on them if automatic initialization
has been disabled by setting the HWEXT_SOUND_NOAUTOINIT
extension bit.
HWPLUG_CAPS_VIDEO:
hw_AddLoaderAdapter()
on them if automatic initialization
has been disabled by setting the HWEXT_VIDEO_NOAUTOINIT
extension bit.
HWPLUG_CAPS_FILEADAPTER:
hw_AddLoaderAdapter()
on them or they will only be available when the user
directly addresses them using the Adapter
tag.
HWPLUG_CAPS_DIRADAPTER:
hw_AddLoaderAdapter()
on them or they will only be available when the user
directly addresses them using the Adapter
tag.
HWPLUG_CAPS_NETWORKADAPTER:
hw_AddLoaderAdapter()
on them or they will only be available when the user
directly addresses them using the Adapter
tag. (V8.0)
HWPLUG_CAPS_ICON:
hw_AddLoaderAdapter()
on them if automatic initialization
has been disabled by setting the HWEXT_ICON_NOAUTOINIT
extension bit. (V9.0)
HWPLUG_CAPS_FONT:
hw_AddLoaderAdapter()
on them if automatic initialization
has been disabled by setting the HWEXT_FONT_NOAUTOINIT
extension bit. (V10.0)
HWPLUG_CAPS_FILESYSADAPTER:
hw_AddLoaderAdapter()
on them or they will only be available when the user
directly addresses them using the Adapter
tag. (V10.0)
Please note that this function cannot be used to activate display, timer, requester, and audio adapters. These all have custom functions that are used for their activation, e.g. hw_SetDisplayAdapter() for display adapters.
This function should be called from inside your RequirePlugin()
implementation. If this function succeeds, Hollywood will call your loader or adapter whenever
it needs to open an object of the respective type and your plugin can then choose which
objects it would like to handle. In the first parameter, you have to pass a pointer to the
hwPluginBase
that Hollywood has passed to your plugin's InitPlugin() function.
The second parameter has to specify the type of the loader or adapter to add (see above
for supported types). Note that this must not be a combination of types, but only a single
loader or adapter type can be activated per call.
Loaders and adapters may be added and removed any time you want. They are not a one time setting,
though traditionally you will want to install your loaders and adapters when your RequirePlugin()
is called as a result of the user running @REQUIRE
on your plugin. But this is not a must.
You may also choose to add and remove loaders and adapters at any later time. When Hollywood opens an
object, the loaders and adapters will be asked whether they want to handle this object in the order
they were added into the system. First come, first served.
It is not necessary to remove the loader or adapter using hw_RemoveLoaderAdapter() when your plugin is closed. Hollywood will do this automatically for you.
Please note that even if this function hasn't been called, Hollywood can still call your loaders and adapters. This will happen if the user directly addresses a loader or an adapter in the script. Consider the following example:
LoadBrush(1, "a.tiff.pp", {Loader = "tiff", Adapter = "powerpacker"}) |
This Hollywood code will call into the file adapter of powerpacker
.hwp and into the image
loader of tiff
.hwp directly, no matter if they have been activated or not. If loaders
and adapters are addressed directly, Hollywood will always call them if the respective
plugins are not disabled. Thus, it is advised that you call hw_ConfigureLoaderAdapter()
in your InitPlugin() implementation because RequirePlugin()
might not even be called if the user addresses the loader or adapter directly. See hw_ConfigureLoaderAdapter for details.
Starting with Hollywood 7.1 hw_ConfigureLoaderAdapter()
allows you to forbid Hollywood calling into plugins that haven't been required. This
can be done by setting one of the HWCLAXXX_MUSTREQUIRE
flags. See hw_ConfigureLoaderAdapter for details.
hwPluginBase
pointer passed to InitPlugin()