It’s entirely up to you if you want to provide a default icon using those functions, but only as a fallback mechanism. And, as a fallback, it will have limitations.
It’s been 20 years since the introduction of the desktop entry and the base directory specifications in the Linux/freedesktop world: there are no “OSes” that do not follow the freedesktop specification, unless you fell into a time hole to 1997. The entire point of those specifications is to ensure that you only have to target a single platform instead of a collection of random components.
Ok, i didn’t want to talk about Linux system particulary but also Windows etc.
Thank you for your answering, i will try by defining a .desktop file and icon file according to the freedesktop way.
I have to notice though, that the fallback system seems buggy, at least in my case because it gives bad result compared to the same apps in GTK2. Do not know why.