From 0ea4f79dbe060079e861249e10ffb75a6f82c448 Mon Sep 17 00:00:00 2001 From: Curve Date: Mon, 2 Sep 2024 16:50:58 +0200 Subject: [PATCH] feat(icon): add `data` --- include/saucer/icon.h | 2 ++ src/icon.cpp | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/include/saucer/icon.h b/include/saucer/icon.h index f719b1a..9e41bc9 100644 --- a/include/saucer/icon.h +++ b/include/saucer/icon.h @@ -13,7 +13,9 @@ extern "C" struct saucer_icon; SAUCER_EXPORT void saucer_icon_free(saucer_icon *); + SAUCER_EXPORT bool saucer_icon_empty(saucer_icon *); + SAUCER_EXPORT saucer_stash *saucer_icon_data(saucer_icon *); SAUCER_EXPORT void saucer_icon_save(saucer_icon *, const char *path); diff --git a/src/icon.cpp b/src/icon.cpp index 06c905e..3f9d41a 100644 --- a/src/icon.cpp +++ b/src/icon.cpp @@ -13,6 +13,11 @@ extern "C" return handle->value().empty(); } + saucer_stash *saucer_icon_data(saucer_icon *handle) + { + return saucer_stash::from(handle->value().data()); + } + void saucer_icon_save(saucer_icon *handle, const char *path) { handle->value().save(path);