Re: gdkwin32.h / gdk_win32_drawable_get_handle()



On 22.01.2017 13:29, John Emmas via gtk-devel-list wrote:
Is it permissiable to #include <gdk/gdkprivate.h> in client code?  Here's the
scenario (I discovered this in gtk-2-24 so apologies if it's been fixed in a
more recent version...)

'gdk/gdkwin32.h' declares some functions, including
gdk_win32_drawable_get_handle().  It isn't declared anywhere else AFAICT and
there's an accompanying macro called GDK_WINDOW_HWND.  A #ifdef test (called
INSIDE_GDK_WIN32) makes the macro call that function if the build is _not_
INSIDE_GDK_WIN32.  So it looks like it's allowable to #include <gdk/gdkwin32.h>
from within client code.

HOWEVER... gdkwin32.h #includes gdk/gdkprivate.h (which I'd guess is NOT
supposed to get #included in client code).

Just wanted to check if #including a private header is okay in client code.

This seems to be absent in gtk+-3.x, so it must be a gtk+-2.x-only thing. And
gtk+-4.x removes the divide between gtk and gdk. Also, one of the functions
from gdk/gdkprivate.h is gdk_window_destroy_notify(), which is used by gtk2
code, so if gtk and applications are equal in their gdk access, this seems OK.
Also, gdk/x11/gdkx.h (seems to be the main X11 backend header) includes
gdkprivate.h.

Either way, i doubt that anyone wants to rearrange headers in gtk+-2.x. As long
as everything works.

-- 
O< ascii ribbon - stop html email! - www.asciiribbon.org

Attachment: 0x6759BA74.asc
Description: application/pgp-keys

Attachment: signature.asc
Description: OpenPGP digital signature



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]