added check for GTK 1.2
added symbol __WXGTK12__ (do not use GTK_MINOR_VERSION in your code as this is undefined anywhere outside wxGTK itself) updated wxGTK.spec for local builds fixed clipboard clear/setdata race test for wxConvLocal in dialogs sample git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2291 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
14
configure.in
14
configure.in
@@ -1111,6 +1111,8 @@ WX_LINK=
|
|||||||
|
|
||||||
MAKEINCLUDE=
|
MAKEINCLUDE=
|
||||||
|
|
||||||
|
WXGTK12=
|
||||||
|
|
||||||
if test "$wxUSE_GTK" = 1; then
|
if test "$wxUSE_GTK" = 1; then
|
||||||
AM_PATH_GTK(1.0.0, [
|
AM_PATH_GTK(1.0.0, [
|
||||||
GUI_TK_INCLUDE="$GTK_CFLAGS"
|
GUI_TK_INCLUDE="$GTK_CFLAGS"
|
||||||
@@ -1120,6 +1122,9 @@ if test "$wxUSE_GTK" = 1; then
|
|||||||
TOOLKIT_DEF=__WXGTK__
|
TOOLKIT_DEF=__WXGTK__
|
||||||
WX_LINK=-lwx_gtk2
|
WX_LINK=-lwx_gtk2
|
||||||
MAKEINCLUDE=../gtk.inc
|
MAKEINCLUDE=../gtk.inc
|
||||||
|
AM_PATH_GTK(1.2.0, [
|
||||||
|
WXGTK12=1
|
||||||
|
], AC_MSG_RESULT(no))
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "$wxUSE_QT" = 1; then
|
if test "$wxUSE_QT" = 1; then
|
||||||
@@ -1224,6 +1229,10 @@ dnl ----------------------------------------------------------------
|
|||||||
dnl Register compile options for makefiles and setup.h
|
dnl Register compile options for makefiles and setup.h
|
||||||
dnl ----------------------------------------------------------------
|
dnl ----------------------------------------------------------------
|
||||||
|
|
||||||
|
if test "$WXGTK12" = 1 ; then
|
||||||
|
AC_DEFINE_UNQUOTED(__WXGTK12__,$WXGTK12)
|
||||||
|
fi
|
||||||
|
|
||||||
EXTRA_LINK=
|
EXTRA_LINK=
|
||||||
|
|
||||||
WXDEBUG=
|
WXDEBUG=
|
||||||
@@ -1488,7 +1497,12 @@ if test "$wxUSE_TOOLTIPS" = 1 ; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if test "$wxUSE_DRAG_AND_DROP" = 1 ; then
|
if test "$wxUSE_DRAG_AND_DROP" = 1 ; then
|
||||||
|
if test "$WXGTK12" = 1 ; then
|
||||||
AC_DEFINE_UNQUOTED(wxUSE_DRAG_AND_DROP,$wxUSE_DRAG_AND_DROP)
|
AC_DEFINE_UNQUOTED(wxUSE_DRAG_AND_DROP,$wxUSE_DRAG_AND_DROP)
|
||||||
|
else
|
||||||
|
AC_MSG_WARN(drag and drop is only supported under GTK 1.2, sorry)
|
||||||
|
wxUSE_DRAG_AND_DROP=0
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
dnl ----------------------------------------------------------------
|
dnl ----------------------------------------------------------------
|
||||||
|
@@ -7,6 +7,7 @@ __X__ any X, but not GTK
|
|||||||
__WXMOTIF__ Motif
|
__WXMOTIF__ Motif
|
||||||
__WXXT__ Xt; mutually exclusive with WX_MOTIF (?)
|
__WXXT__ Xt; mutually exclusive with WX_MOTIF (?)
|
||||||
__WXGTK__ GTK
|
__WXGTK__ GTK
|
||||||
|
__WXGTK12__ GTK 1.2 or higher
|
||||||
__WXMSW__ Any Windows
|
__WXMSW__ Any Windows
|
||||||
__WXMAC__ MacOS
|
__WXMAC__ MacOS
|
||||||
__UNIX__ any Unix
|
__UNIX__ any Unix
|
||||||
|
@@ -221,7 +221,7 @@ WXDLLEXPORT_DATA(extern wxANOTHER_MBCONV(wxMBConvFile)) wxConvFile;
|
|||||||
WXDLLEXPORT_DATA(extern wxANOTHER_MBCONV(wxMBConvUTF7)) wxConvUTF7;
|
WXDLLEXPORT_DATA(extern wxANOTHER_MBCONV(wxMBConvUTF7)) wxConvUTF7;
|
||||||
WXDLLEXPORT_DATA(extern wxANOTHER_MBCONV(wxMBConvUTF8)) wxConvUTF8;
|
WXDLLEXPORT_DATA(extern wxANOTHER_MBCONV(wxMBConvUTF8)) wxConvUTF8;
|
||||||
#define wxConv_UTF8 wxConvUTF8
|
#define wxConv_UTF8 wxConvUTF8
|
||||||
#if defined(__WXGTK__) && (GTK_MINOR_VERSION > 0)
|
#if defined(__WXGTK12__)
|
||||||
WXDLLEXPORT_DATA(extern wxANOTHER_MBCONV(wxMBConvGdk)) wxConvGdk;
|
WXDLLEXPORT_DATA(extern wxANOTHER_MBCONV(wxMBConvGdk)) wxConvGdk;
|
||||||
#define wxConv_gdk wxConvGdk
|
#define wxConv_gdk wxConvGdk
|
||||||
#endif // GTK > 1.0
|
#endif // GTK > 1.0
|
||||||
|
@@ -47,6 +47,10 @@ MyCanvas *myCanvas = (MyCanvas *) NULL;
|
|||||||
// `Main program' equivalent, creating windows and returning main app frame
|
// `Main program' equivalent, creating windows and returning main app frame
|
||||||
bool MyApp::OnInit(void)
|
bool MyApp::OnInit(void)
|
||||||
{
|
{
|
||||||
|
#if defined(__WXGTK__) && defined(wxUSE_UNICODE)
|
||||||
|
wxConvCurrent = &wxConvLocal;
|
||||||
|
#endif
|
||||||
|
|
||||||
m_canvasTextColour = wxColour("BLACK");
|
m_canvasTextColour = wxColour("BLACK");
|
||||||
m_canvasFont = *wxNORMAL_FONT;
|
m_canvasFont = *wxNORMAL_FONT;
|
||||||
|
|
||||||
|
@@ -16,7 +16,16 @@
|
|||||||
#pragma interface
|
#pragma interface
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------------ */
|
||||||
|
/* define if support for GTK 1.2 features */
|
||||||
|
/* ------------------------------------------------------------------------ */
|
||||||
|
|
||||||
|
#undef __WXGTK12__
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------------ */
|
||||||
/* define the system to compile */
|
/* define the system to compile */
|
||||||
|
/* ------------------------------------------------------------------------ */
|
||||||
|
|
||||||
#undef __UNIX__
|
#undef __UNIX__
|
||||||
#undef __LINUX__
|
#undef __LINUX__
|
||||||
#undef __SGI__
|
#undef __SGI__
|
||||||
|
@@ -1841,7 +1841,7 @@ size_t wxMBConvFile::WC2MB(char *buf, const wchar_t *psz, size_t n) const
|
|||||||
// standard gdk conversion
|
// standard gdk conversion
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
|
||||||
#if defined(__WXGTK__) && (GTK_MINOR_VERSION > 0)
|
#ifdef __WXGTK12__
|
||||||
WXDLLEXPORT_DATA(wxMBConvGdk) wxConvGdk;
|
WXDLLEXPORT_DATA(wxMBConvGdk) wxConvGdk;
|
||||||
|
|
||||||
#include <gdk/gdk.h>
|
#include <gdk/gdk.h>
|
||||||
|
@@ -224,6 +224,7 @@ selection_clear_clip( GtkWidget *WXUNUSED(widget), GdkEventSelection *event )
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
wxTheClipboard->m_waiting = FALSE;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -239,6 +240,7 @@ selection_clear_clip( GtkWidget *WXUNUSED(widget), GdkEventSelection *event )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wxTheClipboard->m_waiting = FALSE;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -388,12 +390,20 @@ void wxClipboard::Clear()
|
|||||||
|
|
||||||
if (gdk_selection_owner_get( g_clipboardAtom ) == m_clipboardWidget->window)
|
if (gdk_selection_owner_get( g_clipboardAtom ) == m_clipboardWidget->window)
|
||||||
{
|
{
|
||||||
|
m_waiting = TRUE;
|
||||||
|
|
||||||
gtk_selection_owner_set( (GtkWidget*) NULL, g_clipboardAtom, GDK_CURRENT_TIME );
|
gtk_selection_owner_set( (GtkWidget*) NULL, g_clipboardAtom, GDK_CURRENT_TIME );
|
||||||
|
|
||||||
|
while (m_waiting) gtk_main_iteration();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gdk_selection_owner_get( GDK_SELECTION_PRIMARY ) == m_clipboardWidget->window)
|
if (gdk_selection_owner_get( GDK_SELECTION_PRIMARY ) == m_clipboardWidget->window)
|
||||||
{
|
{
|
||||||
|
m_waiting = TRUE;
|
||||||
|
|
||||||
gtk_selection_owner_set( (GtkWidget*) NULL, GDK_SELECTION_PRIMARY, GDK_CURRENT_TIME );
|
gtk_selection_owner_set( (GtkWidget*) NULL, GDK_SELECTION_PRIMARY, GDK_CURRENT_TIME );
|
||||||
|
|
||||||
|
while (m_waiting) gtk_main_iteration();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_dataBroker)
|
if (m_dataBroker)
|
||||||
|
@@ -224,6 +224,7 @@ selection_clear_clip( GtkWidget *WXUNUSED(widget), GdkEventSelection *event )
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
wxTheClipboard->m_waiting = FALSE;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -239,6 +240,7 @@ selection_clear_clip( GtkWidget *WXUNUSED(widget), GdkEventSelection *event )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wxTheClipboard->m_waiting = FALSE;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -388,12 +390,20 @@ void wxClipboard::Clear()
|
|||||||
|
|
||||||
if (gdk_selection_owner_get( g_clipboardAtom ) == m_clipboardWidget->window)
|
if (gdk_selection_owner_get( g_clipboardAtom ) == m_clipboardWidget->window)
|
||||||
{
|
{
|
||||||
|
m_waiting = TRUE;
|
||||||
|
|
||||||
gtk_selection_owner_set( (GtkWidget*) NULL, g_clipboardAtom, GDK_CURRENT_TIME );
|
gtk_selection_owner_set( (GtkWidget*) NULL, g_clipboardAtom, GDK_CURRENT_TIME );
|
||||||
|
|
||||||
|
while (m_waiting) gtk_main_iteration();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gdk_selection_owner_get( GDK_SELECTION_PRIMARY ) == m_clipboardWidget->window)
|
if (gdk_selection_owner_get( GDK_SELECTION_PRIMARY ) == m_clipboardWidget->window)
|
||||||
{
|
{
|
||||||
|
m_waiting = TRUE;
|
||||||
|
|
||||||
gtk_selection_owner_set( (GtkWidget*) NULL, GDK_SELECTION_PRIMARY, GDK_CURRENT_TIME );
|
gtk_selection_owner_set( (GtkWidget*) NULL, GDK_SELECTION_PRIMARY, GDK_CURRENT_TIME );
|
||||||
|
|
||||||
|
while (m_waiting) gtk_main_iteration();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_dataBroker)
|
if (m_dataBroker)
|
||||||
|
40
wxGTK.spec
40
wxGTK.spec
@@ -1,13 +1,19 @@
|
|||||||
Summary: The GTK+ 1.2 port of wxWindows library
|
# Note that this is NOT a relocatable package
|
||||||
|
%define pref /usr
|
||||||
|
%define ver 2.1.0
|
||||||
|
%define rel 3
|
||||||
|
|
||||||
|
Summary: The GTK+ 1.2 port of the wxWindows library
|
||||||
Name: wxGTK
|
Name: wxGTK
|
||||||
Version: 2.1.0
|
Version: %{ver}
|
||||||
Release: 2
|
Release: %{rel}
|
||||||
Copyright: wxWindows Licence
|
Copyright: wxWindows Licence
|
||||||
Group: X11/Libraries
|
Group: X11/Libraries
|
||||||
Source: ftp://wesley.informatik.uni-freiburg.de/pub/linux/wxxt/source/wxGTK21b.tgz
|
Source: ftp://wesley.informatik.uni-freiburg.de/pub/linux/wxxt/source/wxGTK21b.tgz
|
||||||
URL: http://www.freiburg.linux.de/~wxxt/docs.html
|
URL: http://wesley.informatik.uni-freiburg.de/~wxxt/docs.html
|
||||||
Packager: Robert Roebling <roebling@ruf.uni-freiburg.de>
|
Packager: Robert Roebling <roebling@ruf.uni-freiburg.de>
|
||||||
Requires: gtk+ >= 1.2.0
|
Requires: gtk+ >= 1.2.1
|
||||||
|
BuildRoot: /tmp/wxgtk_root
|
||||||
|
|
||||||
# all packages providing an implementation of wxWindows library (regardless of
|
# all packages providing an implementation of wxWindows library (regardless of
|
||||||
# the toolkit used) should provide the (virtual) wxwin package, this makes it
|
# the toolkit used) should provide the (virtual) wxwin package, this makes it
|
||||||
@@ -18,17 +24,20 @@ Provides: wxwin
|
|||||||
wxWindows is a free C++ library for cross-platform GUI development.
|
wxWindows is a free C++ library for cross-platform GUI development.
|
||||||
With wxWindows, you can create applications for different GUIs (GTK+,
|
With wxWindows, you can create applications for different GUIs (GTK+,
|
||||||
Motif/LessTif, MS Windows, Mac) from the same source code.
|
Motif/LessTif, MS Windows, Mac) from the same source code.
|
||||||
This package also contains a dialog editor.
|
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -n wxGTK
|
%setup -n wxGTK
|
||||||
./configure --prefix=/usr --with-threads
|
./configure --prefix=%{pref} --with-threads --with-unicode
|
||||||
|
|
||||||
%build
|
%build
|
||||||
make
|
make
|
||||||
|
|
||||||
%install
|
%install
|
||||||
make install
|
rm -rf $RPM_BUILD_ROOT
|
||||||
|
make prefix=$RPM_BUILD_ROOT%{pref} install
|
||||||
|
|
||||||
|
%clean
|
||||||
|
rm -rf $RPM_BUILD_ROOT
|
||||||
|
|
||||||
%post
|
%post
|
||||||
/sbin/ldconfig
|
/sbin/ldconfig
|
||||||
@@ -37,11 +46,14 @@ make install
|
|||||||
/sbin/ldconfig
|
/sbin/ldconfig
|
||||||
|
|
||||||
%files
|
%files
|
||||||
|
%defattr (644, root, root, 755)
|
||||||
%doc COPYING.LIB INSTALL.txt LICENCE.txt README.txt SYMBOLS.txt TODO.txt
|
%doc COPYING.LIB INSTALL.txt LICENCE.txt README.txt SYMBOLS.txt TODO.txt
|
||||||
/usr/include/wx
|
%dir %{pref}/include/wx
|
||||||
/usr/lib/wx
|
%{pref}/include/wx/*
|
||||||
/usr/lib/libwx_gtk2.so
|
%dir %{pref}/lib/wx
|
||||||
/usr/lib/libwx_gtk2.so.1
|
%{pref}/lib/wx/*
|
||||||
/usr/lib/libwx_gtk2.so.1.0
|
%attr(755, -, -) %{pref}/lib/libwx_gtk2.so
|
||||||
/usr/bin/wx-config
|
%attr(755, -, -) %{pref}/lib/libwx_gtk2.so.1
|
||||||
|
%attr(755, -, -) %{pref}/lib/libwx_gtk2.so.1.0
|
||||||
|
%attr(755, -, -) %{pref}/bin/wx-config
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user