aboutsummaryrefslogtreecommitdiff
path: root/libs/nak_ffi/include
diff options
context:
space:
mode:
authorSulfurNitride <SulfurNitride@users.noreply.github.com>2026-03-12 13:48:25 -0500
committerSulfurNitride <SulfurNitride@users.noreply.github.com>2026-03-12 13:48:25 -0500
commit84a43a2e6afbdfab92c610d47aa75e3876ffacd6 (patch)
treeea624ec287181905441fbf1247c645976bdb8fc9 /libs/nak_ffi/include
parent3ba283d9350783c038cc2844450f4938ad125f08 (diff)
Replace wrestool with native Rust PE icon extraction (pelite)
- Add icons.rs to nak crate: parses PE resource sections, extracts RT_GROUP_ICON/RT_ICON and builds ICO files in memory - Expose nak_extract_exe_icon() FFI for C++ consumption - Update iconForExecutable() to use Rust FFI instead of shelling out to wrestool; reads all ICO entries for correct color depth - Fix BasicGamePlugin::gameIcon() to call iconForExecutable() (was returning empty QIcon, causing placeholder icons for BG3/Cyberpunk) - Move app icon setup: setDesktopFileName + setWindowIcon to MOApplication constructor (fixes Wayland taskbar/decoration icon) - Move data/com.fluorine.* to data/icons/, install to XDG paths at launch for Wayland compositor icon resolution - Remove icoutils dependency from Docker image and build output Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'libs/nak_ffi/include')
-rw-r--r--libs/nak_ffi/include/nak_ffi.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/libs/nak_ffi/include/nak_ffi.h b/libs/nak_ffi/include/nak_ffi.h
index cc66d9e..e1a9185 100644
--- a/libs/nak_ffi/include/nak_ffi.h
+++ b/libs/nak_ffi/include/nak_ffi.h
@@ -176,6 +176,23 @@ char *nak_ensure_dxvk_conf(void);
char *nak_get_dxvk_conf_path(void);
/* ========================================================================
+ * Tier 8: PE Icon Extraction
+ * ======================================================================== */
+
+/** Result of icon extraction */
+typedef struct {
+ uint8_t *data; /**< Raw ICO file bytes (NULL if extraction failed) */
+ size_t len; /**< Length in bytes (0 if extraction failed) */
+} NakIconData;
+
+/** Extract the best icon from a Windows PE executable (.exe/.dll).
+ * Returns raw ICO bytes. Free with nak_icon_data_free(). */
+NakIconData nak_extract_exe_icon(const char *exe_path);
+
+/** Free icon data returned by nak_extract_exe_icon */
+void nak_icon_data_free(NakIconData icon);
+
+/* ========================================================================
* General
* ======================================================================== */