APTR handle = LoadIcon(STRPTR filename, struct hwTagList *tags);
NULL
. The handle returned by LoadIcon()
is
an opaque datatype that only your plugin knows about. Hollywood will simply pass
this handle back to your GetIconImages() function when it wants to
get the individual images in your icon.
Hollywood may also pass a tag list to your LoadIcon()
implementation. This
list may contain the following tags:
HWLDICONTAG_ADAPTER:
pData
member to open the icon. This means that you
have to use hw_FOpenExt() instead of hw_FOpen()
to open the icon file because the former doesn't support file adapters. See hw_FOpenExt for details.
HWLDICONTAG_AMIGAEXT:
pData
points to a struct hwIconAmigaExt
that your plugin
can initialize with metadata obtained from the icon. This is for compatibility with
Amiga icons which contain metadata in addition to the image data. struct hwIconAmigaExt
looks like this:
struct hwIconAmigaExt { int Type; int ViewMode; int IconX; int IconY; int DrawerX; int DrawerY; int DrawerWidth; int DrawerHeight; int StackSize; STRPTR DefaultTool; STRPTR *ToolTypes; ULONG Flags; }; |
Here's an explanation of the individual structure members:
Type:
HWAMIGAICON_NONE HWAMIGAICON_DISK HWAMIGAICON_DRAWER HWAMIGAICON_TOOL HWAMIGAICON_PROJECT HWAMIGAICON_GARBAGE HWAMIGAICON_DEVICE HWAMIGAICON_KICKSTART |
ViewMode:
HWAMIGAICONMODE_NONE HWAMIGAICONMODE_ICONS HWAMIGAICONMODE_NAME HWAMIGAICONMODE_DATE HWAMIGAICONMODE_SIZE HWAMIGAICONMODE_TYPE |
IconX:
IconY:
DrawerX:
Type
is set to a container type like HWAMIGAICON_DRAWER
,
set this to the x position of the new window that will be opened
when double-clicking the icon.
DrawerY:
Type
is set to a container type like HWAMIGAICON_DRAWER
,
set this to the y position of the new window that will be opened
when double-clicking the icon.
DrawerWidth:
Type
is set to a container type like HWAMIGAICON_DRAWER
,
set this to the width of the new window that will be opened when
double-clicking the icon.
DrawerHeight:
Type
is set to a container type like HWAMIGAICON_DRAWER
,
set this to the height of the new window that will be opened when
double-clicking the icon.
StackSize:
Type
is set to HWAMIGAICON_TOOL
or HWAMIGAICON_PROJECT
,
the desired stack size for the program to be launched.
DefaultTool:
Type
is set to HWAMIGAICON_PROJECT
, this must be set to
a null-terminated string containing name (and optionally path) of
the program to open the file with.
ToolTypes:
STRPTR
, each array item containing a single tooltype
stored as a null-terminated string. The array you pass here must be terminated
by a NULL
entry which must be the last one.
Flags:
HWAMIGAICONFLAGS_VIEWALL:
Type
is a container type like HWAMIGAICON_DRAWER
, all
files will be visible, not only those that have an icon.
HWLDICONTAG_USERTAGS:
pData
will point to a struct hwUserTagList
containing
a list of user tags passed by the Hollywood script. User tags are a way of passing additional information
from Hollywood scripts to plugin functions. Note that even if your plugin doesn't
support any user tags, you should still look for this tag and pass the user
tags to hw_FOpenExt because the user tags passed in UserTags
could
also be intended for another plugin, namely the file adapter plugin passed
in Adapter
. See User tags for details. (V10.0)
Please note that you should not use ANSI C functions like fopen()
to
open the file that is passed to this function because the filename that is passed
to this function can also be a specially formatted filename specification that
Hollywood uses to load files that have been linked to applets or executables. In
order to be able to load these files correctly, you have to use special IO functions
provided by Hollywood. See File IO information for details.
NULL
NULL
if plugin doesn't
want to handle this icon