The GNOME project has devhelp, which acts as a documentation browser and search index for the GNOME family of libraries and their language bindings (GTK, Cairo, Pango, GStreamer, PyGTK, and so on). It would probably be a good starting point for extending to include other documentation.
You can use Devhelp to read the documentation of functions etc.
I don't know any easy way to find the source code. Searching for the name in Gitlab won't be that efficient, since functions usually are defined once and used many times.
In your specific example, g_return_if_fail
is part of Glib not Gtk (as indicated by the g_
prefix) and it is a macro not a function. You can find its definitions by searching for define g_return_if_fail
in Glib.
Glade for GTK2 most likely could be installed, just not necessarily by using the package system on most distros.
There may be more examples in GTK2, but the GTK3 documentation is actually very thorough from what I've seen. Try out devhelp some time.
The backwards compatibility of Windows is part of why Windows is bloated overall. Also, "don't break user space" is about kernel development, GTK+ is user space.
Generally speaking, when the programming API, though not necessarily the ABI or theming API, will be broken, GTK has been good about giving warning ahead. As mentioned, nothing has been dropped from GTK3, just deprecated, which means when they are dropped there are years of warning. The deprecated API pieces won't be dropped until the release of GTK4.
Let's also remember that GNOME is not Linux. There is plenty of interest in Linux in the professional space, particularly servers, just not as much on the desktop. GTK also isn't 100% tied to Linux as it is, in fact, cross-platform.