Please review the code that is in play when icons.svg *is* used. It does use the theme mechanism. Your assertion that there is *no* way to do this is not true.
OK, I wasn't correct. There is no obvious and easy way in the GTK documentation to do this. One can use gtk_icon_theme_add_builtin_icon, but it can't be used to add scalable builtin icons, we'd have to re-render them in response to logical icon size changes. If we had a list of icons and logical sizes at which they are used, this could work.
Another thing that could be used is custom stock items. But there is no GtkIconSource for a scalable icon, unless I omitted something, so a re-render on size change still has to happen. It seems to me that the current icon.cpp code uses something like this, but I'm not sure. On top of that, I don't know whether defining a stock item "foo" will also cause the builtin named icon "foo" to be added to the icon theme.
Tell me your general idea if you have one different from those two (custom stock items, builtin icons).
Again, the current icons.svg file code *does* work with icons, falling back, etc.
It does work but: 1. It seems I have to use sp_icon_new instead of gtk_image_new_from_icon_name. Thus GtkImageMenuItem, GtkAction, etc. won't work correctly unless they are subclassed. 2. At present the fallback order is a bit off. (icons.svg from user folder should be first, themed icons second, and system icons.svg last; currently it is themed icons, user icons.svg, system icons.svg, unless there were some changes I didn't notice)
WE CAN NOT USE LIBRSVG TO GET FULL FEATURES OF SVG!!!!
Yes, but I think that full features of SVG are not necessary for icons. Everyone else is confined to the librsvg subset and they create excellent artwork. It should not be a major problem for us to stick to it. Another thought: if Inkscape's icons are not librsvg-compliant, they are less useful, because people can't reuse them or their modified versions in desktop themes. So using librsvg, even it's not as technically appealing as reusing our canvas renderer, has a few real advantages (speed, memory footprint, icon compatibility with desktop themes, convenient APIs).
An exception to this is filter icons: of course they can't be rendered by librsvg, and there is no reason for them to be themable because they are just illustrations of the filters' functions, so they should still be rendered by Inkscape.
Please keep in mind that not everyone will be running the latest and greatest versions of all libraries. You *must* keep cross-platform support in mind for any code work you do on Inkscape. One of our key promises is good cross-platform support.
I agree, the icons need testing on more versions of librsvg
Regards, Krzysztof Kosiński