app_icon_abi.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /* Full-colour application icons and the NBAPP1 icon bundle.
  2. *
  3. * Shared by the ring-3 WM (user/lib/uwm/uwm_lib.c, user/apps/wm/ucmd_wm.c)
  4. * and the host tool tools/mkappicons.c, which converts the 96 px PNGs in
  5. * assets/icons/apps/ into /ramfs/icons/apps96.icn.
  6. *
  7. * APP_ICON_LIST is an X-macro: X(ENUM_SUFFIX, "source file"). The order is
  8. * the icon id and the order of the images in the bundle, so append only.
  9. * The source files are the upstream GNOME app icon basenames; assets/icons/apps/
  10. * holds both the unchanged SVGs and the pre-rendered <name>.png files. */
  11. #ifndef APP_ICON_ABI_H
  12. #define APP_ICON_ABI_H
  13. #define APP_ICON_LIST(X) \
  14. X(TERMINAL, "org.gnome.Console") \
  15. X(FILES, "org.gnome.Nautilus") \
  16. X(WEB, "org.gnome.Epiphany") \
  17. X(CHAT, "org.gnome.Fractal") \
  18. X(EDITOR, "org.gnome.TextEditor") \
  19. X(GALLERY, "org.gnome.Adwaita1.Demo") \
  20. X(CLOCK, "org.gnome.clocks") \
  21. X(COLORS, "org.gnome.design.Palette") \
  22. X(MINES, "org.gnome.Mines") \
  23. X(CARDS, "gnome-aisleriot") \
  24. X(DISKS, "org.gnome.DiskUtility") \
  25. X(TASKS, "org.gnome.SystemMonitor") \
  26. X(SERVICES, "org.gnome.tweaks") \
  27. X(SETTINGS, "org.gnome.Settings") \
  28. X(DATETIME, "org.gnome.Calendar")
  29. #define APP_ICON_ENUM_(e, file) APP_ICON_##e,
  30. enum app_icon {
  31. APP_ICON_LIST(APP_ICON_ENUM_)
  32. APP_ICON_COUNT
  33. };
  34. #undef APP_ICON_ENUM_
  35. /* Bundle geometry. The dock draws at a 48 px base and magnifies to 1.75x,
  36. * so 96 px keeps every scale at native resolution or downscaled. */
  37. #define APP_ICON_PX 96
  38. #define APP_ICON_BUNDLE_PATH "/ramfs/icons/apps96.icn"
  39. /* ---- NBAPP1 bundle ------------------------------------------------------
  40. * [struct app_icon_file_hdr][count x (96*96 premultiplied RGB565+alpha)]
  41. * One pixel is three little-endian bytes: RGB565 low/high, then alpha.
  42. * The RGB channels are premultiplied by alpha, so a scaled blit can use
  43. * source-over without dark fringes on the transparent edges. */
  44. #define APP_ICON_FILE_MAGIC "NBAPP1\0\0"
  45. struct app_icon_file_hdr {
  46. char magic[8];
  47. unsigned short count; /* number of icons */
  48. unsigned short size; /* icon edge in px, APP_ICON_PX */
  49. unsigned int reserved;
  50. };
  51. #endif