Merge branch 'gtk1-fix'

Fix building wxGTK with GTK+ 1 after gtk/private/wrapgtk.h addition.

Closes https://github.com/wxWidgets/wxWidgets/pull/850
This commit is contained in:
Vadim Zeitlin
2018-07-11 19:26:16 +02:00
10 changed files with 129 additions and 26 deletions

20
configure vendored
View File

@@ -1040,7 +1040,6 @@ infodir
docdir docdir
oldincludedir oldincludedir
includedir includedir
runstatedir
localstatedir localstatedir
sharedstatedir sharedstatedir
sysconfdir sysconfdir
@@ -1461,7 +1460,6 @@ datadir='${datarootdir}'
sysconfdir='${prefix}/etc' sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com' sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var' localstatedir='${prefix}/var'
runstatedir='${localstatedir}/run'
includedir='${prefix}/include' includedir='${prefix}/include'
oldincludedir='/usr/include' oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@@ -1714,15 +1712,6 @@ do
| -silent | --silent | --silen | --sile | --sil) | -silent | --silent | --silen | --sile | --sil)
silent=yes ;; silent=yes ;;
-runstatedir | --runstatedir | --runstatedi | --runstated \
| --runstate | --runstat | --runsta | --runst | --runs \
| --run | --ru | --r)
ac_prev=runstatedir ;;
-runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
| --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
| --run=* | --ru=* | --r=*)
runstatedir=$ac_optarg ;;
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;; ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1860,7 +1849,7 @@ fi
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \ datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
libdir localedir mandir runstatedir libdir localedir mandir
do do
eval ac_val=\$$ac_var eval ac_val=\$$ac_var
# Remove trailing slashes. # Remove trailing slashes.
@@ -2013,7 +2002,6 @@ Fine tuning of the installation directories:
--sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var] --localstatedir=DIR modifiable single-machine data [PREFIX/var]
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
--libdir=DIR object code libraries [EPREFIX/lib] --libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include] --includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include] --oldincludedir=DIR C header files for non-gcc [/usr/include]
@@ -34150,7 +34138,11 @@ fi
if test "$wxUSE_SECRETSTORE" = "yes"; then if test "$wxUSE_SECRETSTORE" = "yes"; then
if test "$wxUSE_MSW" != "1" -a "$wxUSE_OSX_COCOA" != 1; then if test "$WXGTK1" = "1"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libsecret is incompatible with GTK+ 1, disabled" >&5
$as_echo "$as_me: WARNING: libsecret is incompatible with GTK+ 1, disabled" >&2;}
wxUSE_SECRETSTORE=no
elif test "$wxUSE_MSW" != "1" -a "$wxUSE_OSX_COCOA" != 1; then
pkg_failed=no pkg_failed=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBSECRET" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBSECRET" >&5

View File

@@ -5419,7 +5419,10 @@ dnl ---------------------------------------------------------------------------
if test "$wxUSE_SECRETSTORE" = "yes"; then if test "$wxUSE_SECRETSTORE" = "yes"; then
dnl The required APIs are always available under MSW and OS X but we must dnl The required APIs are always available under MSW and OS X but we must
dnl have GNOME libsecret under Unix to be able to compile this class. dnl have GNOME libsecret under Unix to be able to compile this class.
if test "$wxUSE_MSW" != "1" -a "$wxUSE_OSX_COCOA" != 1; then if test "$WXGTK1" = "1"; then
AC_MSG_WARN([libsecret is incompatible with GTK+ 1, disabled])
wxUSE_SECRETSTORE=no
elif test "$wxUSE_MSW" != "1" -a "$wxUSE_OSX_COCOA" != 1; then
PKG_CHECK_MODULES(LIBSECRET, [libsecret-1], PKG_CHECK_MODULES(LIBSECRET, [libsecret-1],
[ [
CXXFLAGS="$LIBSECRET_CFLAGS $CXXFLAGS" CXXFLAGS="$LIBSECRET_CFLAGS $CXXFLAGS"

View File

@@ -0,0 +1,80 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/gtk/private/addremovectrl.h
// Purpose: GTK specific wxAddRemoveImpl implementation
// Author: Vadim Zeitlin
// Created: 2015-02-05
// Copyright: (c) 2015 Vadim Zeitlin <vadim@wxwidgets.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GTK_PRIVATE_ADDREMOVECTRL_H_
#define _WX_GTK_PRIVATE_ADDREMOVECTRL_H_
#include "wx/artprov.h"
#include "wx/bmpbuttn.h"
#include "wx/toolbar.h"
#include <gtk/gtk.h>
// ----------------------------------------------------------------------------
// wxAddRemoveImpl
// ----------------------------------------------------------------------------
class wxAddRemoveImpl : public wxAddRemoveImplBase
{
public:
wxAddRemoveImpl(wxAddRemoveAdaptor* adaptor,
wxAddRemoveCtrl* parent,
wxWindow* ctrlItems)
: wxAddRemoveImplBase(adaptor, parent, ctrlItems),
m_tbar(new wxToolBar(parent, wxID_ANY))
{
m_tbar->AddTool(wxID_ADD, wxString(), GetNamedBitmap("list-add"));
m_tbar->AddTool(wxID_REMOVE, wxString(), GetNamedBitmap("list-remove"));
#if defined(__WXGTK3__) && !defined(__WXUNIVERSAL__)
// Tweak the toolbar appearance to correspond to how the toolbars used
// in other GNOME applications for similar purposes look.
GtkToolbar* const toolbar = m_tbar->GTKGetToolbar();
GtkStyleContext* context = gtk_widget_get_style_context(GTK_WIDGET(toolbar));
gtk_style_context_add_class(context, GTK_STYLE_CLASS_INLINE_TOOLBAR);
gtk_style_context_set_junction_sides(context, GTK_JUNCTION_TOP);
#endif // GTK+3
wxSizer* const sizerTop = new wxBoxSizer(wxVERTICAL);
sizerTop->Add(ctrlItems, wxSizerFlags(1).Expand());
sizerTop->Add(m_tbar, wxSizerFlags().Expand());
parent->SetSizer(sizerTop);
m_tbar->Bind(wxEVT_UPDATE_UI,
&wxAddRemoveImplBase::OnUpdateUIAdd, this, wxID_ADD);
m_tbar->Bind(wxEVT_UPDATE_UI,
&wxAddRemoveImplBase::OnUpdateUIRemove, this, wxID_REMOVE);
m_tbar->Bind(wxEVT_TOOL, &wxAddRemoveImplBase::OnAdd, this, wxID_ADD);
m_tbar->Bind(wxEVT_TOOL, &wxAddRemoveImplBase::OnRemove, this, wxID_REMOVE);
}
virtual void SetButtonsToolTips(const wxString& addtip,
const wxString& removetip) wxOVERRIDE
{
m_tbar->SetToolShortHelp(wxID_ADD, addtip);
m_tbar->SetToolShortHelp(wxID_REMOVE, removetip);
}
private:
static wxBitmap GetNamedBitmap(const wxString& name)
{
// GTK UI guidelines recommend using "symbolic" versions of the icons
// for these buttons, so try them first but fall back to the normal
// ones if symbolic theme is not installed.
wxBitmap bmp = wxArtProvider::GetBitmap(name + "-symbolic", wxART_MENU);
if ( !bmp.IsOk() )
bmp = wxArtProvider::GetBitmap(name, wxART_MENU);
return bmp;
}
wxToolBar* const m_tbar;
};
#endif // _WX_GTK_PRIVATE_ADDREMOVECTRL_H_

View File

@@ -145,8 +145,10 @@ protected:
#ifdef __WXOSX__ #ifdef __WXOSX__
#include "wx/osx/private/addremovectrl.h" #include "wx/osx/private/addremovectrl.h"
#elif defined(__WXGTK__) #elif defined(__WXGTK20__)
#include "wx/gtk/private/addremovectrl.h" #include "wx/gtk/private/addremovectrl.h"
#elif defined(__WXGTK__)
#include "wx/gtk1/private/addremovectrl.h"
#else #else
#include "wx/generic/private/addremovectrl.h" #include "wx/generic/private/addremovectrl.h"
#endif #endif

View File

@@ -43,7 +43,12 @@
#ifdef __WXGTK__ #ifdef __WXGTK__
#include "wx/renderer.h" #include "wx/renderer.h"
#include "wx/gtk/private/wrapgtk.h" #ifdef __WXGTK20__
#include "wx/gtk/private/wrapgtk.h"
#else
#include <gtk/gtk.h>
#define gtk_widget_is_drawable GTK_WIDGET_DRAWABLE
#endif
#ifdef __WXGTK3__ #ifdef __WXGTK3__
#include "wx/graphics.h" #include "wx/graphics.h"
#include "wx/gtk/private.h" #include "wx/gtk/private.h"

View File

@@ -41,8 +41,11 @@
#include "wx/scrolbar.h" #include "wx/scrolbar.h"
#endif // __WXUNIVERSAL__ #endif // __WXUNIVERSAL__
#ifdef __WXGTK__ #ifdef __WXGTK20__
#include "wx/gtk/private/wrapgtk.h" #include "wx/gtk/private/wrapgtk.h"
#elif defined(__WXGTK__)
#include <gtk/gtk.h>
#define gtk_widget_get_window(x) x->window
#elif defined(__WXMSW__) #elif defined(__WXMSW__)
#include "wx/msw/private.h" #include "wx/msw/private.h"
#elif defined(__WXX11__) #elif defined(__WXX11__)

View File

@@ -103,13 +103,17 @@
#include "wx/msw/private.h" #include "wx/msw/private.h"
#endif #endif
#if wxUSE_GUI && defined(__WXGTK__) #if wxUSE_GUI
#include "wx/gtk/private/wrapgtk.h" // for GTK_XXX_VERSION constants // Include the definitions of GTK_XXX_VERSION constants.
#ifdef __WXGTK20__
#include "wx/gtk/private/wrapgtk.h"
#elif defined(__WXGTK__)
#include <gtk/gtk.h>
#elif defined(__WXQT__)
#include <QtCore/QtGlobal> // for QT_VERSION_STR constants
#endif
#endif #endif
#if wxUSE_GUI && defined(__WXQT__)
#include <QtCore/QtGlobal> // for QT_VERSION_STR constants
#endif
#if wxUSE_BASE #if wxUSE_BASE
// ============================================================================ // ============================================================================

View File

@@ -83,7 +83,11 @@ using namespace std;
#endif #endif
#ifdef __WXGTK__ #ifdef __WXGTK__
#ifdef __WXGTK20__
#include "wx/gtk/private/wrapgtk.h" #include "wx/gtk/private/wrapgtk.h"
#else // GTK+ 1.x
#include <gtk/gtk.h>
#endif
#include "wx/fontutil.h" #include "wx/fontutil.h"
#ifndef __WXGTK3__ #ifndef __WXGTK3__
#include "wx/gtk/dc.h" #include "wx/gtk/dc.h"

View File

@@ -64,7 +64,11 @@
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
#if defined(__WXGTK__) #if defined(__WXGTK__)
#ifdef __WXGTK20__
#include "wx/gtk/private/wrapgtk.h" #include "wx/gtk/private/wrapgtk.h"
#else // GTK+ 1.x
#include <gtk/gtk.h>
#endif
#include <gdk/gdkx.h> #include <gdk/gdkx.h>
#define GetDisplay() GDK_DISPLAY() #define GetDisplay() GDK_DISPLAY()
#define GetXWindow(wxwin) GDK_WINDOW_XWINDOW((wxwin)->m_widget->window) #define GetXWindow(wxwin) GDK_WINDOW_XWINDOW((wxwin)->m_widget->window)

View File

@@ -37,7 +37,12 @@
#endif #endif
#ifdef __WXGTK__ #ifdef __WXGTK__
#ifdef __WXGTK20__
#include "wx/gtk/private/wrapgtk.h" #include "wx/gtk/private/wrapgtk.h"
#else // GTK+ 1.x
#include <gtk/gtk.h>
#define GDK_WINDOWING_X11
#endif
#ifdef GDK_WINDOWING_X11 #ifdef GDK_WINDOWING_X11
#include <gdk/gdkx.h> #include <gdk/gdkx.h>
#endif #endif
@@ -45,8 +50,9 @@ GdkWindow* wxGetTopLevelGDK();
GtkWidget* wxGetTopLevelGTK(); GtkWidget* wxGetTopLevelGTK();
#endif #endif
// Only X11 backend is supported for wxGTK here // Only X11 backend is supported for wxGTK here (GTK < 2 has no others)
#if !defined(__WXGTK__) || defined(GDK_WINDOWING_X11) #if !defined(__WXGTK__) || \
(!defined(__WXGTK20__) || defined(GDK_WINDOWING_X11))
// Various X11 Atoms used in this file: // Various X11 Atoms used in this file:
static Atom _NET_WM_STATE = 0; static Atom _NET_WM_STATE = 0;