GNOME Bugzilla – Bug 615292
Use single GTK and Glib includes
Last modified: 2010-07-15 01:33:49 UTC
GTK+ is moving toward a model where it is only allowed to include the 'toplevel' headers. See http://live.gnome.org/GnomeGoals/CleanupGTKIncludes for more info
Created attachment 158296 [details] [review] Use single GTK includes
Review of attachment 158296 [details] [review]: ::: capplets/display/scrollarea.c @@ +507,3 @@ else if (private->bg_pixmap && + private->bg_pixmap != (GdkPixmap *) GDK_PARENT_RELATIVE && + private->bg_pixmap != (GdkPixmap *) 2L) Eek! No way!
What about adding #define GDK_NO_BG ((GdkPixmap*)2L) to the beginning of the file?
That would certainly be much better already. I guess my main concern, however, would be: why did GDK remove that define (and not others like GDK_PARENT_RELATIVE)? Can we still rely on that value if they removed it from the public interface?
GDK_PARENT_RELATIVE_BG and GDK_NO_BG are defined in gdk/gdkprivate.h, so they are internal GDK defines. I think GDK_NO_BG was never defined as public API
Ok, fine. That makes me think the GDK_PARENT_RELATIVE we're currently using is wrong, though, and should actually be GDK_PARENT_RELATIVE_BG.
gnome-controls-center is currently using GDK_PARENT_RELATIVE_BG. This is a internal define equivalent to (GdkPixmap *) GDK_PARENT_RELATIVE See http://git.gnome.org/browse/gtk+/tree/gdk/gdkprivate.h#n34 Also, GdkWindowObject is not defined in the public api neither. I'm going to split the patch so we can commit the "non-controversial" part.
Created attachment 158430 [details] [review] Use single GTK includes.v2
Created attachment 158431 [details] [review] Do not use GDK internal includes Note that this patch is not complete, as I'm not sure how retrieve the internal bg_pixmap and bg_color variables without use GdkWindowObject
Review of attachment 158431 [details] [review]: ::: capplets/display/scrollarea.c @@ +508,3 @@ } else if (private->bg_pixmap && + private->bg_pixmap != (GdkPixmap *) GDK_PARENT_RELATIVE && Hm. Since we now define GDK_NO_BG ourselves, I'd prefer to have a similar #define GDK_PARENT_RELATIVE_BG ((GdkPixmap *) GDK_PARENT_RELATIVE)
Comment on attachment 158430 [details] [review] Use single GTK includes.v2 commit 6012559536a7144b85571ffad6b69e0c6e0df646
Also, all members of GdkWindowObject were GSEAL'd, so, things like private->bg_pixmap don't build anymore.
See gdk_window_get_back_pixmap and gdk_window_coords_to_parent. Those should let you do what you are doing with direct member access currently.
Created attachment 164621 [details] [review] Make build work with GSEAL Thanks for the hint, Matthias. With this patch I've managed to build g-c-c master in my machine.
Comment on attachment 164621 [details] [review] Make build work with GSEAL Committed, thanks.
Created attachment 164966 [details] [review] Use single GTK and Glib includes This one is still needed
Created attachment 164970 [details] [review] Use single GTK and Glib includes.v3
This is fixed now