After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 739781 - Make global GDK libgtk_only functions more private
Make global GDK libgtk_only functions more private
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: .General
unspecified
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2014-11-07 14:15 UTC by Emmanuele Bassi (:ebassi)
Modified: 2014-11-08 16:32 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Make global GDK libgtk_only functions more private (13.94 KB, patch)
2014-11-07 14:15 UTC, Emmanuele Bassi (:ebassi)
accepted-commit_now Details | Review
Move GDK GL flags accessors to the private vtable (3.80 KB, patch)
2014-11-07 14:36 UTC, Emmanuele Bassi (:ebassi)
accepted-commit_now Details | Review
Hide GdkWindow libgtk_only API in the private vtable (6.42 KB, patch)
2014-11-07 14:38 UTC, Emmanuele Bassi (:ebassi)
accepted-commit_now Details | Review

Description Emmanuele Bassi (:ebassi) 2014-11-07 14:15:24 UTC
we should use the same trick we use in GLib, with a macro accessing a vtable of function pointers.
Comment 1 Emmanuele Bassi (:ebassi) 2014-11-07 14:15:32 UTC
Created attachment 290166 [details] [review]
Make global GDK libgtk_only functions more private

The current way of exposing GDK API that should be considered internal
to GTK+ is to append a 'libgtk_only' suffix to the function name; this
is not really safe.

GLib has been using a slightly different approach: a private table of
function pointers, and a macro that allows accessing the desired symbol
inside that vtable.

We can copy the approach, and deprecate the 'libgtk_only' symbols in
lieu of outright removal.
Comment 2 Emmanuele Bassi (:ebassi) 2014-11-07 14:36:22 UTC
Created attachment 290169 [details] [review]
Move GDK GL flags accessors to the private vtable

This allows us to use the GDK_PRIVATE_CALL macro inside gtk.
Comment 3 Emmanuele Bassi (:ebassi) 2014-11-07 14:38:28 UTC
Created attachment 290170 [details] [review]
Hide GdkWindow libgtk_only API in the private vtable

These are the last two global GDK symbols that have a libgtk_only
suffix.
Comment 4 Matthias Clasen 2014-11-07 21:45:54 UTC
Review of attachment 290166 [details] [review]:

Looks good to me
Comment 5 Matthias Clasen 2014-11-07 21:45:56 UTC
Review of attachment 290166 [details] [review]:

Looks good to me
Comment 6 Matthias Clasen 2014-11-07 21:48:33 UTC
Review of attachment 290169 [details] [review]:

ok
Comment 7 Matthias Clasen 2014-11-07 21:48:41 UTC
Review of attachment 290169 [details] [review]:

ok
Comment 8 Matthias Clasen 2014-11-07 21:49:04 UTC
Review of attachment 290170 [details] [review]:

ok