/*
 * icon_data.h — public C-API for the embedded PNG icon set.
 *
 * The icon data itself lives in icon_data.c, which is build-time-
 * generated by src/icons/embed_icons.py from every .png under
 * src/icons/.  Each PNG becomes a static byte array; collectively
 * they're indexed in a lookup table accessible through this API.
 *
 * Consumers normally don't touch this directly — they go through
 * CamuleArtProvider, which wraps amule_find_icon() in a wxArtProvider
 * subclass and decodes the embedded PNG bytes via wxImage.  The
 * direct-table API (amule_get_all_icons) is exposed for cases where a
 * caller needs to enumerate icons by name (currently:
 * src/IP2Country.cpp iterating over country-flag icons whose codes
 * are stored as part of the icon name itself, e.g. "flag_us").
 *
 * Compiled as C — the byte arrays are pure data with no string
 * literals, so the choice of TU language is mostly stylistic, but
 * keeping it C matches src/xpm_data.c's pattern (icons-as-data live
 * in C TUs) and avoids any future C++ deprecation friction.
 */

#ifndef SRC_ICONS_ICON_DATA_H
#define SRC_ICONS_ICON_DATA_H

#ifdef __cplusplus
extern "C" {
#endif

struct AMuleIconEntry {
	const char *name;            /* art id, e.g. "amule" or "flag_us" */
	const unsigned char *png_data;
	unsigned int png_len;
};

/*
 * Returns a pointer to the entry for the named icon, or NULL if no
 * icon with that name exists.  The returned pointer is valid for the
 * lifetime of the program (the table is static const).
 */
const struct AMuleIconEntry *amule_find_icon(const char *name);

/*
 * Returns the full lookup table.  *count is set to the number of
 * entries; iterate with `for (int i = 0; i < count; ++i) { ... }`.
 * The returned pointer is valid for the lifetime of the program.
 */
const struct AMuleIconEntry *amule_get_all_icons(int *count);

#ifdef __cplusplus
}
#endif

#endif /* SRC_ICONS_ICON_DATA_H */
