GNOME Bugzilla – Bug 730095
Add a private call API to export internals to modules
Last modified: 2014-05-15 01:40:53 UTC
This is modeled on the glib-private.h mechanism in GLib. The gtk__private__() API exports a hidden vtable, and adds a GTK_PRIVATE_CALL() macro to use it conveniently. This mechanism can be used to make internal functions available to code that is part of the GTK+ repository, but lives outside libgtk.so. The first user of this mechanism is the inspector module.
Created attachment 276489 [details] [review] Add a private call API to export internals to modules
Created attachment 276490 [details] [review] inspector: Show GAction information Show the actions that are added to GtkApplication and GtkApplicationWindows, as well as action groups that are inserted elsewhere with gtk_widget_insert_action_group. This patch uses the new GTK_PRIVATE_CALL() api to get information about action groups that is not available via the regular GTK+ api.
Created attachment 276493 [details] [review] GtkActionMuxer: Add getters Add a way to enumerate all prefixes, and to get the action group for a prefix.
Created attachment 276494 [details] [review] Add private GtkWidget api for action groups Similar to the just-added action muxer api for enumerating action prefixes and for getting the action group for a prefix.
Created attachment 276495 [details] [review] Add a private call API to export internals to modules This is modeled on the glib-private.h mechanism in GLib. The gtk__private__() API exports a hidden vtable, and adds a GTK_PRIVATE_CALL() macro to use it conveniently. This mechanism can be used to make internal functions available to code that is part of the GTK+ repository, but lives outside libgtk.so. The first user of this mechanism is the inspector module.
Created attachment 276496 [details] [review] inspector: Show GAction information Show the actions that are added to GtkApplication and GtkApplicationWindows, as well as action groups that are inserted elsewhere with gtk_widget_insert_action_group. This patch uses the new GTK_PRIVATE_CALL() api to get information about action groups that is not available via the regular GTK+ api.
Benjamin suggested as an alternative to move the inspector from being a module into libgtk, giving it full access to internals.
Attachment 276493 [details] pushed as 4396bbd - GtkActionMuxer: Add getters Attachment 276494 [details] pushed as 3f224a7 - Add private GtkWidget api for action groups Attachment 276496 [details] pushed as 2d2f986 - inspector: Show GAction information