From 01eea03796eea96a9a5a3fdf6516b89f66db95b1 Mon Sep 17 00:00:00 2001 From: postsolar <120750161+postsolar@users.noreply.github.com> Date: Sat, 24 Feb 2024 23:50:41 +0200 Subject: [PATCH] Add `Gtk.IconInfo.filename` --- src/Gtk/IconInfo.js | 4 ++++ src/Gtk/IconInfo.purs | 12 +++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 src/Gtk/IconInfo.js diff --git a/src/Gtk/IconInfo.js b/src/Gtk/IconInfo.js new file mode 100644 index 0000000..8b70af3 --- /dev/null +++ b/src/Gtk/IconInfo.js @@ -0,0 +1,4 @@ +export const getFilenameImpl = + iconInfo => + iconInfo.get_filename() + diff --git a/src/Gtk/IconInfo.purs b/src/Gtk/IconInfo.purs index e2b7bb5..3db037b 100644 --- a/src/Gtk/IconInfo.purs +++ b/src/Gtk/IconInfo.purs @@ -1,4 +1,14 @@ -module Gtk.IconInfo where +module Gtk.IconInfo (GtkIconInfo, filename) where + +import Data.Maybe (Maybe) +import Data.Nullable (Nullable, toMaybe) +import Prelude ((<<<)) foreign import data GtkIconInfo ∷ Type +-- | Returns the full path to the icon, unless it's a builtin icon. +filename ∷ GtkIconInfo → Maybe String +filename = toMaybe <<< getFilenameImpl + +foreign import getFilenameImpl ∷ GtkIconInfo → Nullable String +