Name
hw_GetIcons -- get application icons (V6.0)
Synopsis
struct hwIconList *list = hw_GetIcons(void);
Function
This function returns a list of all application icons that are currently available. This list may contain user-defined icons that have been specified using the @APPICON preprocessor command, inbuilt default Hollywood icons or icons that have been linked to an applet or executable.

This function is especially useful for display adapters which redirect Hollywood's output to a custom display device and want to register the script's icons with this custom display device or toolkit. By calling hw_GetIcons() display adapters can easily obtain a list with all icons currently defined by the script. hw_GetIcons() 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:

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

Data:
This will be set to a 32-bit ARGB pixel buffer containing the icon's image data. This currently can never be CLUT data because hw_GetIcons() currently doesn't support CLUT images. The alpha byte will always be set for every pixel. The pixel buffer's size will be exactly width * height * 4. No row padding will be used. The pixel buffer pointer will be valid until you call hw_FreeIcons().

Width:
Contains the icon's width.

Height:
Contains the icon's height.

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

HWICONFLAGS_DEFAULT:
This flag marks the default icon. Hollywood's @APPICON preprocessor command allows scripts to designate an icon as the default one. It's up to you how you interpret and handle the default icon. On most systems you can probably ignore this flag because icons are chosen depending on the current screen resolution.

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

Palette:
This will always be NULL because hw_GetIcons() currently won't return palette images. (V9.0)

TransPen:
This will always be HWPEN_NONE because hw_GetIcons() currently won't return palette images. (V9.0)

Depth:
This will always be 32 because hw_GetIcons() currently won't return palette images. (V9.0)

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

Do not expect this list to be sorted. The individual icons can be stored in an order that is completely random inside this list.

Designer compatibility
Unsupported

Inputs
none

Results
list
a list containing all available icons or NULL on error

Show TOC