[Gambas-user] Gio icon, GIcon serialized for DesktopPortal Notify?

vuott at tutanota.com vuott at tutanota.com
Sun Nov 26 01:35:44 CET 2023


« Does gambas do GIcon or anything from Gio library?
   Will i need Extern library calls? »

Do you say something like this ?

[code]
Library "libgio-2.0:0.7200.4"

' GIcon* g_themed_icon_new (const char* iconname)
' Creates a new themed icon.
Private Extern g_themed_icon_new(iconname As String) As Pointer

' GVariant* g_icon_serialize (GIcon* icon)
' Serializes a GIcon into a GVariant.
Private Extern g_icon_serialize(icon As Pointer) As Pointer

' void g_variant_unref (GVariant* value)
' Decreases the reference count of value.
Private Extern g_variant_unref(value As Pointer)

' void g_object_unref (gpointer object)
' Decreases the reference count of object.
Private Extern g_object_unref(gobject As Pointer)


Public Sub Main()

  Dim ico, gv As Pointer

  ico = g_themed_icon_new("org.freedesktop.portal.Notification")

  gv = g_icon_serialize(ico)

  ......
  ......

  g_variant_unref(gv)
  g_object_unref(ico)

End
[/code]




25 nov 2023, 17:13 da bsteers4 at gmail.com:

> I'm using gb.dbus and desktop portal Notify
>
> I want to add an image.
> docs say i need a serialized GThemedIcon or GBytesIcon
> https://docs.gtk.org/gio/method.Icon.serialize.html
> https://www.manpagez.com/html/gio/gio-2.44.1/GBytesIcon.php
> https://developer-old.gnome.org/gio/stable/GThemedIcon.html#g-themed-icon-new
>
> Does gambas do GIcon or anything from Gio library?
>
> Will i need Extern library calls?
>
> Has anyone managed to add an image to dbus notification?
>
> Thanks in advance
> BruceS
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20231126/c1c4ac1c/attachment-0001.htm>


More information about the User mailing list