hw_GetIconImages -- get all images inside icon (V8.0)
struct hwIconList *list = hw_GetIconImages(lua_ID *id, struct hwTagList
This function can be used to get copies of all images stored inside an icon object. You have to pass the object identifier of the icon whose images you want to obtain. The object identifier must be passed as a lua_ID. See Object identifiers for details.

hw_GetIconImages() will return a pointer to a struct hwIconList which looks like this:

struct hwIconList
    struct hwIconList *Succ;
    APTR Data;
    int Width;
    int Height;
    ULONG Flags;
    ULONG *Palette;     // V9.0
    ULONG TransPen;     // V9.0
    int Depth;          // V9.0
    APTR UserData;      // V9.0

For each node in the list, struct hw_IconList will be initialized as follows:

Contains a pointer to the next list node or NULL if this node is the last one.

This will be set to either a 32-bit ARGB or an 8-bit CLUT pixel buffer containing the image data of this item, depending on whether the Palette member contains a valid palette. If Data contains 32-bit ARGB pixels, the alpha byte will always be set for every pixel. The pixel buffer's size will be exactly width * height * bpp. No row padding will be used. The pixel buffer pointer will be valid until you call hw_FreeIcons().

Contains the image's width.

Contains the image's height.

This contains a combination of flags for this image. The following flags are currently supported:

This flag marks the default icon. Hollywood's icon type allows scripts to designate an icon as the default one. It's up to you how you interpret and handle the default icon.

If this flag is set, the image in this list node describes a selected icon state. On AmigaOS and compatibles, icon images usually have two states: normal and selected. You can get the image of the selected icon state by checking if this flag is set.

This flag is set if the image doesn't use any transparency and all alpha bytes are set to 255 (i.e. visible).

This flag is set if struct hwIconList has the structure extensions introduced in Hollywood 9.0. Before you access any of those extensions, e.g. the Palette or Depth members, you must either check if this flag is set or if the Hollywood version that opened your plugin is at least 9.0. (V9.0)

If the image is a palette image, this will be set to a pointer to an array of ULONGs which contains the palette colors for the image. The palette colors are stored as raw RGB values. Note that you need to explicitly request palette image support by setting the HWGIITAG_PALETTE tag to True (see below) or hw_GetIconImages() will never return palette images. (V9.0)

If the image is a palette image and has a transparent pen, this pen will be returned in this member. If there is no transparent pen, HWPEN_NONE will be written to this member. Note that you need to explicitly request palette image support by setting the HWGIITAG_PALETTE tag to True (see below) or this member will never be set. (V9.0)

This will be set to the image's depth. (V9.0)

hw_GetIconImages() also accepts a tag list which allows you to configure some further options. The following tags are currently recognized:

If you set this tag to True, hw_GetIconImages() will also return palette images inside the icon. For compatibility reasons, this is not done by default because palette images inside icons weren't supported before Hollywood 9.0. Thus, plugins need to explicitly request them before they are returned. This can be done by setting this tag to True. (V9.0)

The list that is returned by this function must be freed using the hw_FreeIcons() function. See hw_FreeIcons for details.

Note that in contrast to the list returned by hw_GetIcons(), the list returned by hw_GetIconImages() will be sorted from small to large sizes.

Designer compatibility

object identifier of icon whose images you want to get
reserved for future use; pass NULL
a list containing all images in the icon object or NULL on error

Show TOC