From a73251a80d95efa37bf1fc7879b21a6aec57910d Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 13 Jul 2012 18:22:22 +0000 Subject: [PATCH] Allow building wxGTK3 with Broadway backend. Use GDK_WINDOWING_BROADWAY to fix compilation with it. Closes #14469. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72075 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/changes.txt | 4 ++++ src/gtk/nativewin.cpp | 4 ++++ src/gtk/utilsgtk.cpp | 14 ++++++++++++++ src/gtk/window.cpp | 2 +- src/unix/displayx11.cpp | 2 +- src/unix/utilsx11.cpp | 7 +++++++ 6 files changed, 31 insertions(+), 2 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index 20d2c67..8d1c48a 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -531,6 +531,10 @@ All (GUI): - Add possibility to hide and show again wxRibbonBar pages (wxBen). - Fix item data access in wxDataViewListCtrl (Kry). +wxGTK: + +- Allow building wxGTK3 with Broadway backend (Kolya Kosenko). + 2.9.4: (released 2012-07-09) ------ diff --git a/src/gtk/nativewin.cpp b/src/gtk/nativewin.cpp index 99ded72..d95d980 100644 --- a/src/gtk/nativewin.cpp +++ b/src/gtk/nativewin.cpp @@ -96,8 +96,12 @@ bool wxNativeContainerWindow::Create(wxNativeContainerWindowId anid) { bool rc; #ifdef __WXGTK3__ +#ifdef GDK_WINDOWING_X11 GdkWindow * const win = gdk_x11_window_foreign_new_for_display(gdk_display_get_default(), anid); #else + GdkWindow * const win = NULL; +#endif +#else GdkWindow * const win = gdk_window_foreign_new(anid); #endif if ( win ) diff --git a/src/gtk/utilsgtk.cpp b/src/gtk/utilsgtk.cpp index f68fddc..728c9f6 100644 --- a/src/gtk/utilsgtk.cpp +++ b/src/gtk/utilsgtk.cpp @@ -504,3 +504,17 @@ wxGUIAppTraits::GetStandardCmdLineOptions(wxArrayString& names, } #endif // __UNIX__ + +#ifdef GDK_WINDOWING_BROADWAY + +bool wxLaunchDefaultApplication(const wxString& document, int flags) +{ + return false; +} + +bool wxDoLaunchDefaultBrowser(const wxString& url, int flags) +{ + return false; +} + +#endif diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index 36344c4..71f22ac 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -2143,7 +2143,7 @@ wxWindow *wxGetActiveWindow() // Under Unix this is implemented using X11 functions in utilsx11.cpp but we // need to have this function under Windows too, so provide at least a stub. -#ifdef __WINDOWS__ +#ifndef GDK_WINDOWING_X11 bool wxGetKeyState(wxKeyCode WXUNUSED(key)) { wxFAIL_MSG(wxS("Not implemented under Windows")); diff --git a/src/unix/displayx11.cpp b/src/unix/displayx11.cpp index 04c5f86..6f97e92 100644 --- a/src/unix/displayx11.cpp +++ b/src/unix/displayx11.cpp @@ -382,7 +382,7 @@ bool wxDisplayImplX11::ChangeMode(const wxVideoMode& WXUNUSED(mode)) #include "wx/utils.h" -#if wxUSE_LIBHILDON || wxUSE_LIBHILDON2 +#if wxUSE_LIBHILDON || wxUSE_LIBHILDON2 || !defined(GDK_WINDOWING_X11) void wxClientDisplayRect(int *x, int *y, int *width, int *height) { diff --git a/src/unix/utilsx11.cpp b/src/unix/utilsx11.cpp index ef81b90..b111e2b 100644 --- a/src/unix/utilsx11.cpp +++ b/src/unix/utilsx11.cpp @@ -38,8 +38,13 @@ #ifdef __WXGTK__ #include +#ifdef GDK_WINDOWING_X11 #include #endif +#endif + +// Only X11 backend is supported for wxGTK here +#if !defined(__WXGTK__) || defined(GDK_WINDOWING_X11) // Various X11 Atoms used in this file: static Atom _NET_WM_STATE = 0; @@ -925,4 +930,6 @@ bool wxDoLaunchDefaultBrowser(const wxString& url, int flags) return false; } +#endif // !defined(__WXGTK__) || defined(GDK_WINDOWING_X11) + #endif // __WXX11__ || __WXGTK__ || __WXMOTIF__ -- 2.7.4