icon_abi.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /* UI icons and the NBICO1 icon bundle.
  2. *
  3. * Shared by ngui (user/lib/ngui: enum ngui_icon, ngui_icon()) and the host
  4. * tool tools/mkicons.c, which rasterizes the Adwaita symbolic SVGs in
  5. * assets/icons/adwaita/ into /ramfs/icons/adwaita16.icn.
  6. *
  7. * ICON_LIST is an X-macro: X(ENUM_SUFFIX, "short name", "theme file"). The
  8. * order is the icon id and the order of the masks in the bundle, so append
  9. * only. */
  10. #ifndef ICON_ABI_H
  11. #define ICON_ABI_H
  12. #define ICON_LIST(X) \
  13. X(FOLDER, "folder", "folder-symbolic") \
  14. X(FILE, "file", "text-x-generic-symbolic") \
  15. X(DISK, "disk", "drive-harddisk-symbolic") \
  16. X(UP, "up", "go-up-symbolic") \
  17. X(HOME, "home", "go-home-symbolic") \
  18. X(REFRESH, "refresh", "view-refresh-symbolic") \
  19. X(PLUS, "plus", "list-add-symbolic") \
  20. X(CHEVRON_LEFT, "back", "go-previous-symbolic") \
  21. X(CHEVRON_RIGHT, "forward", "go-next-symbolic") \
  22. X(STOP, "stop", "process-stop-symbolic") \
  23. X(CLOSE, "close", "window-close-symbolic") \
  24. X(SEARCH, "search", "system-search-symbolic") \
  25. X(MENU, "menu", "open-menu-symbolic")
  26. /* ---- NBICO1 bundle ------------------------------------------------------
  27. * [struct icon_file_hdr][count x size*size coverage bytes]
  28. * One 8-bit coverage mask per icon (0 = transparent, 255 = opaque), rows
  29. * top to bottom, in ICON_LIST order. Symbolic icons are single-colour, so
  30. * the drawing side tints the mask with the theme colour. Little-endian. */
  31. #define ICON_FILE_MAGIC "NBICO1\0\0"
  32. struct icon_file_hdr {
  33. char magic[8];
  34. unsigned short count; /* number of masks */
  35. unsigned short size; /* mask edge in px, e.g. 16 */
  36. unsigned int reserved;
  37. };
  38. #endif