Declare gtk_icon_size_lookup if it is missing from the GTK+ headers (Bug 1177079)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34629 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
167
configure
vendored
167
configure
vendored
@@ -25789,7 +25789,7 @@ libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config
|
|||||||
save_CFLAGS="$CFLAGS"
|
save_CFLAGS="$CFLAGS"
|
||||||
save_LIBS="$LIBS"
|
save_LIBS="$LIBS"
|
||||||
CFLAGS="$CFLAGS $wx_cv_cflags_gtk"
|
CFLAGS="$CFLAGS $wx_cv_cflags_gtk"
|
||||||
LIBS="$LIBS $wx_cv_lib_gtk"
|
LIBS="$LIBS $wx_cv_libs_gtk"
|
||||||
|
|
||||||
|
|
||||||
for ac_func in pango_font_family_is_monospace
|
for ac_func in pango_font_family_is_monospace
|
||||||
@@ -25894,6 +25894,68 @@ fi
|
|||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
|
echo "$as_me:$LINENO: checking if gtk_icon_size_lookup is missing" >&5
|
||||||
|
echo $ECHO_N "checking if gtk_icon_size_lookup is missing... $ECHO_C" >&6
|
||||||
|
cat >conftest.$ac_ext <<_ACEOF
|
||||||
|
/* confdefs.h. */
|
||||||
|
_ACEOF
|
||||||
|
cat confdefs.h >>conftest.$ac_ext
|
||||||
|
cat >>conftest.$ac_ext <<_ACEOF
|
||||||
|
/* end confdefs.h. */
|
||||||
|
|
||||||
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
|
||||||
|
void *f = gtk_icon_size_lookup;
|
||||||
|
|
||||||
|
;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
_ACEOF
|
||||||
|
rm -f conftest.$ac_objext
|
||||||
|
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
|
||||||
|
(eval $ac_compile) 2>conftest.er1
|
||||||
|
ac_status=$?
|
||||||
|
grep -v '^ *+' conftest.er1 >conftest.err
|
||||||
|
rm -f conftest.er1
|
||||||
|
cat conftest.err >&5
|
||||||
|
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||||
|
(exit $ac_status); } &&
|
||||||
|
{ ac_try='test -z "$ac_c_werror_flag"
|
||||||
|
|| test ! -s conftest.err'
|
||||||
|
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
|
||||||
|
(eval $ac_try) 2>&5
|
||||||
|
ac_status=$?
|
||||||
|
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||||
|
(exit $ac_status); }; } &&
|
||||||
|
{ ac_try='test -s conftest.$ac_objext'
|
||||||
|
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
|
||||||
|
(eval $ac_try) 2>&5
|
||||||
|
ac_status=$?
|
||||||
|
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||||
|
(exit $ac_status); }; }; then
|
||||||
|
|
||||||
|
echo "$as_me:$LINENO: result: no" >&5
|
||||||
|
echo "${ECHO_T}no" >&6
|
||||||
|
|
||||||
|
else
|
||||||
|
echo "$as_me: failed program was:" >&5
|
||||||
|
sed 's/^/| /' conftest.$ac_ext >&5
|
||||||
|
|
||||||
|
|
||||||
|
cat >>confdefs.h <<\_ACEOF
|
||||||
|
#define NEED_GTK_ICON_SIZE_LOOKUP 1
|
||||||
|
_ACEOF
|
||||||
|
|
||||||
|
echo "$as_me:$LINENO: result: yes" >&5
|
||||||
|
echo "${ECHO_T}yes" >&6
|
||||||
|
|
||||||
|
fi
|
||||||
|
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
|
||||||
|
|
||||||
echo "$as_me:$LINENO: checking if GTK+ is version >= 2.4" >&5
|
echo "$as_me:$LINENO: checking if GTK+ is version >= 2.4" >&5
|
||||||
echo $ECHO_N "checking if GTK+ is version >= 2.4... $ECHO_C" >&6
|
echo $ECHO_N "checking if GTK+ is version >= 2.4... $ECHO_C" >&6
|
||||||
cat >conftest.$ac_ext <<_ACEOF
|
cat >conftest.$ac_ext <<_ACEOF
|
||||||
@@ -30145,7 +30207,11 @@ if test "$cross_compiling" = "yes"; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
WX_LIBRARY_BASENAME_NOGUI="wx_base${WXBASEPORT}${lib_unicode_suffix}${lib_debug_suffix}${WX_LIB_FLAVOUR}"
|
WX_LIBRARY_BASENAME_NOGUI="wx_base${WXBASEPORT}${lib_unicode_suffix}${lib_debug_suffix}${WX_LIB_FLAVOUR}"
|
||||||
WX_LIBRARY_BASENAME_GUI="wx_${TOOLKIT_DIR}${TOOLKIT_VERSION}${WIDGET_SET}${lib_unicode_suffix}${lib_debug_suffix}${WX_LIB_FLAVOUR}"
|
if test "${TOOLKIT_DIR}" = "os2"; then
|
||||||
|
WX_LIBRARY_BASENAME_GUI="wx_pm${WIDGET_SET}${lib_unicode_suffix}${lib_debug_suffix}${WX_LIB_FLAVOUR}"
|
||||||
|
else
|
||||||
|
WX_LIBRARY_BASENAME_GUI="wx_${TOOLKIT_DIR}${TOOLKIT_VERSION}${WIDGET_SET}${lib_unicode_suffix}${lib_debug_suffix}${WX_LIB_FLAVOUR}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -35615,6 +35681,103 @@ echo "$as_me: WARNING: wxThread::Kill() will not work properly" >&2;}
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
echo "$as_me:$LINENO: checking for pthread_attr_setstacksize" >&5
|
||||||
|
echo $ECHO_N "checking for pthread_attr_setstacksize... $ECHO_C" >&6
|
||||||
|
if test "${ac_cv_func_pthread_attr_setstacksize+set}" = set; then
|
||||||
|
echo $ECHO_N "(cached) $ECHO_C" >&6
|
||||||
|
else
|
||||||
|
cat >conftest.$ac_ext <<_ACEOF
|
||||||
|
/* confdefs.h. */
|
||||||
|
_ACEOF
|
||||||
|
cat confdefs.h >>conftest.$ac_ext
|
||||||
|
cat >>conftest.$ac_ext <<_ACEOF
|
||||||
|
/* end confdefs.h. */
|
||||||
|
/* Define pthread_attr_setstacksize to an innocuous variant, in case <limits.h> declares pthread_attr_setstacksize.
|
||||||
|
For example, HP-UX 11i <limits.h> declares gettimeofday. */
|
||||||
|
#define pthread_attr_setstacksize innocuous_pthread_attr_setstacksize
|
||||||
|
|
||||||
|
/* System header to define __stub macros and hopefully few prototypes,
|
||||||
|
which can conflict with char pthread_attr_setstacksize (); below.
|
||||||
|
Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
|
||||||
|
<limits.h> exists even on freestanding compilers. */
|
||||||
|
|
||||||
|
#ifdef __STDC__
|
||||||
|
# include <limits.h>
|
||||||
|
#else
|
||||||
|
# include <assert.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#undef pthread_attr_setstacksize
|
||||||
|
|
||||||
|
/* Override any gcc2 internal prototype to avoid an error. */
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C"
|
||||||
|
{
|
||||||
|
#endif
|
||||||
|
/* We use char because int might match the return type of a gcc2
|
||||||
|
builtin and then its argument prototype would still apply. */
|
||||||
|
char pthread_attr_setstacksize ();
|
||||||
|
/* The GNU C library defines this for functions which it implements
|
||||||
|
to always fail with ENOSYS. Some functions are actually named
|
||||||
|
something starting with __ and the normal name is an alias. */
|
||||||
|
#if defined (__stub_pthread_attr_setstacksize) || defined (__stub___pthread_attr_setstacksize)
|
||||||
|
choke me
|
||||||
|
#else
|
||||||
|
char (*f) () = pthread_attr_setstacksize;
|
||||||
|
#endif
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
int
|
||||||
|
main ()
|
||||||
|
{
|
||||||
|
return f != pthread_attr_setstacksize;
|
||||||
|
;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
_ACEOF
|
||||||
|
rm -f conftest.$ac_objext conftest$ac_exeext
|
||||||
|
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
|
||||||
|
(eval $ac_link) 2>conftest.er1
|
||||||
|
ac_status=$?
|
||||||
|
grep -v '^ *+' conftest.er1 >conftest.err
|
||||||
|
rm -f conftest.er1
|
||||||
|
cat conftest.err >&5
|
||||||
|
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||||
|
(exit $ac_status); } &&
|
||||||
|
{ ac_try='test -z "$ac_c_werror_flag"
|
||||||
|
|| test ! -s conftest.err'
|
||||||
|
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
|
||||||
|
(eval $ac_try) 2>&5
|
||||||
|
ac_status=$?
|
||||||
|
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||||
|
(exit $ac_status); }; } &&
|
||||||
|
{ ac_try='test -s conftest$ac_exeext'
|
||||||
|
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
|
||||||
|
(eval $ac_try) 2>&5
|
||||||
|
ac_status=$?
|
||||||
|
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||||
|
(exit $ac_status); }; }; then
|
||||||
|
ac_cv_func_pthread_attr_setstacksize=yes
|
||||||
|
else
|
||||||
|
echo "$as_me: failed program was:" >&5
|
||||||
|
sed 's/^/| /' conftest.$ac_ext >&5
|
||||||
|
|
||||||
|
ac_cv_func_pthread_attr_setstacksize=no
|
||||||
|
fi
|
||||||
|
rm -f conftest.err conftest.$ac_objext \
|
||||||
|
conftest$ac_exeext conftest.$ac_ext
|
||||||
|
fi
|
||||||
|
echo "$as_me:$LINENO: result: $ac_cv_func_pthread_attr_setstacksize" >&5
|
||||||
|
echo "${ECHO_T}$ac_cv_func_pthread_attr_setstacksize" >&6
|
||||||
|
if test $ac_cv_func_pthread_attr_setstacksize = yes; then
|
||||||
|
cat >>confdefs.h <<\_ACEOF
|
||||||
|
#define HAVE_PTHREAD_ATTR_SETSTACKSIZE 1
|
||||||
|
_ACEOF
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
echo "$as_me:$LINENO: checking for pthread_mutexattr_t" >&5
|
echo "$as_me:$LINENO: checking for pthread_mutexattr_t" >&5
|
||||||
|
|||||||
19
configure.in
19
configure.in
@@ -2724,6 +2724,25 @@ libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config
|
|||||||
LIBS="$LIBS $wx_cv_libs_gtk"
|
LIBS="$LIBS $wx_cv_libs_gtk"
|
||||||
|
|
||||||
AC_CHECK_FUNCS([pango_font_family_is_monospace])
|
AC_CHECK_FUNCS([pango_font_family_is_monospace])
|
||||||
|
|
||||||
|
dnl gtk_icon_size_lookup is not available in the GTK+ headers
|
||||||
|
dnl that have shipped with some versions of Sun's JDS. Not using
|
||||||
|
dnl AC_CHECK_FUNCS here since it only checks the function exists
|
||||||
|
dnl in the lib (not the header).
|
||||||
|
AC_MSG_CHECKING([if gtk_icon_size_lookup is missing])
|
||||||
|
AC_TRY_COMPILE([
|
||||||
|
#include <gtk/gtk.h>
|
||||||
|
],
|
||||||
|
[
|
||||||
|
void *f = gtk_icon_size_lookup;
|
||||||
|
],
|
||||||
|
[
|
||||||
|
AC_MSG_RESULT([no])
|
||||||
|
],
|
||||||
|
[
|
||||||
|
AC_DEFINE(NEED_GTK_ICON_SIZE_LOOKUP)
|
||||||
|
AC_MSG_RESULT([yes])
|
||||||
|
])
|
||||||
|
|
||||||
dnl test if we have at least GTK+ 2.4:
|
dnl test if we have at least GTK+ 2.4:
|
||||||
AC_MSG_CHECKING([if GTK+ is version >= 2.4])
|
AC_MSG_CHECKING([if GTK+ is version >= 2.4])
|
||||||
|
|||||||
@@ -136,5 +136,14 @@ inline wxEventType GtkScrollWinTypeToWx(guint scrollType)
|
|||||||
wxString wxEscapeStringForPangoMarkup(const wxString& str);
|
wxString wxEscapeStringForPangoMarkup(const wxString& str);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// The declaration for gtk_icon_size_lookup was accidentally ifdefed out in
|
||||||
|
// GTK+ 2.1.0 which Sun seem to have shipped with some versions of JDS
|
||||||
|
// for Solaris 9 x86.
|
||||||
|
#if NEED_GTK_ICON_SIZE_LOOKUP
|
||||||
|
extern "C" gboolean gtk_icon_size_lookup (GtkIconSize size,
|
||||||
|
gint *width,
|
||||||
|
gint *height);
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif // _WX_GTK_PRIVATE_H_
|
#endif // _WX_GTK_PRIVATE_H_
|
||||||
|
|
||||||
|
|||||||
@@ -136,5 +136,14 @@ inline wxEventType GtkScrollWinTypeToWx(guint scrollType)
|
|||||||
wxString wxEscapeStringForPangoMarkup(const wxString& str);
|
wxString wxEscapeStringForPangoMarkup(const wxString& str);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// The declaration for gtk_icon_size_lookup was accidentally ifdefed out in
|
||||||
|
// GTK+ 2.1.0 which Sun seem to have shipped with some versions of JDS
|
||||||
|
// for Solaris 9 x86.
|
||||||
|
#if NEED_GTK_ICON_SIZE_LOOKUP
|
||||||
|
extern "C" gboolean gtk_icon_size_lookup (GtkIconSize size,
|
||||||
|
gint *width,
|
||||||
|
gint *height);
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif // _WX_GTK_PRIVATE_H_
|
#endif // _WX_GTK_PRIVATE_H_
|
||||||
|
|
||||||
|
|||||||
@@ -967,6 +967,9 @@
|
|||||||
/* Define if you have pango_font_family_is_monospace() (Pango >= 1.3.3) */
|
/* Define if you have pango_font_family_is_monospace() (Pango >= 1.3.3) */
|
||||||
#undef HAVE_PANGO_FONT_FAMILY_IS_MONOSPACE
|
#undef HAVE_PANGO_FONT_FAMILY_IS_MONOSPACE
|
||||||
|
|
||||||
|
/* Define if gtk_icon_size_lookup is missing from the GTK+ headers */
|
||||||
|
#undef NEED_GTK_ICON_SIZE_LOOKUP
|
||||||
|
|
||||||
/* Define if you have Pango xft support */
|
/* Define if you have Pango xft support */
|
||||||
#undef HAVE_PANGO_XFT
|
#undef HAVE_PANGO_XFT
|
||||||
|
|
||||||
|
|||||||
@@ -204,7 +204,7 @@ wxArtProviderCache *wxArtProvider::sm_cache = NULL;
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if defined(__WXGTK20__) && !defined(__WXUNIVERSAL__)
|
#if defined(__WXGTK20__) && !defined(__WXUNIVERSAL__)
|
||||||
#include <gtk/gtk.h>
|
#include "wx/gtk/private.h"
|
||||||
extern GtkIconSize wxArtClientToIconSize(const wxArtClient& client);
|
extern GtkIconSize wxArtClientToIconSize(const wxArtClient& client);
|
||||||
#endif // defined(__WXGTK20__) && !defined(__WXUNIVERSAL__)
|
#endif // defined(__WXGTK20__) && !defined(__WXUNIVERSAL__)
|
||||||
|
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
|
|
||||||
#include "wx/artprov.h"
|
#include "wx/artprov.h"
|
||||||
#include "wx/module.h"
|
#include "wx/module.h"
|
||||||
|
#include "wx/gtk/private.h"
|
||||||
|
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
@@ -160,26 +161,8 @@ static GtkIconSize FindClosestIconSize(const wxSize& size)
|
|||||||
s_sizes[5].icon = GTK_ICON_SIZE_DIALOG;
|
s_sizes[5].icon = GTK_ICON_SIZE_DIALOG;
|
||||||
for (size_t i = 0; i < NUM_SIZES; i++)
|
for (size_t i = 0; i < NUM_SIZES; i++)
|
||||||
{
|
{
|
||||||
#if !defined(GDK_MULTITHREAD_SAFE)
|
gtk_icon_size_lookup(s_sizes[i].icon,
|
||||||
gtk_icon_size_lookup(
|
|
||||||
s_sizes[i].icon,
|
|
||||||
&s_sizes[i].x, &s_sizes[i].y);
|
|
||||||
#else
|
|
||||||
#if GTK_VERSION_CHECK(2,2,0)
|
|
||||||
if (!gtk_verson_check(2,2,0))
|
|
||||||
gtk_icon_size_lookup_for_settings(
|
|
||||||
gtk_settings_get_for_screen(gdk_screen_get_default()),
|
|
||||||
s_sizes[i].icon,
|
|
||||||
&s_sizes[i].x, &s_sizes[i].y);
|
|
||||||
else
|
|
||||||
#else // pre-GTK 2.2
|
|
||||||
{
|
|
||||||
// FIXME
|
|
||||||
gtk_icon_size_lookup(s_sizes[i].icon,
|
|
||||||
&s_sizes[i].x, &s_sizes[i].y);
|
&s_sizes[i].x, &s_sizes[i].y);
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
s_sizesInitialized = true;
|
s_sizesInitialized = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
|
|
||||||
#include "wx/artprov.h"
|
#include "wx/artprov.h"
|
||||||
#include "wx/module.h"
|
#include "wx/module.h"
|
||||||
|
#include "wx/gtk/private.h"
|
||||||
|
|
||||||
#include <gtk/gtk.h>
|
#include <gtk/gtk.h>
|
||||||
|
|
||||||
@@ -160,26 +161,8 @@ static GtkIconSize FindClosestIconSize(const wxSize& size)
|
|||||||
s_sizes[5].icon = GTK_ICON_SIZE_DIALOG;
|
s_sizes[5].icon = GTK_ICON_SIZE_DIALOG;
|
||||||
for (size_t i = 0; i < NUM_SIZES; i++)
|
for (size_t i = 0; i < NUM_SIZES; i++)
|
||||||
{
|
{
|
||||||
#if !defined(GDK_MULTITHREAD_SAFE)
|
gtk_icon_size_lookup(s_sizes[i].icon,
|
||||||
gtk_icon_size_lookup(
|
|
||||||
s_sizes[i].icon,
|
|
||||||
&s_sizes[i].x, &s_sizes[i].y);
|
|
||||||
#else
|
|
||||||
#if GTK_VERSION_CHECK(2,2,0)
|
|
||||||
if (!gtk_verson_check(2,2,0))
|
|
||||||
gtk_icon_size_lookup_for_settings(
|
|
||||||
gtk_settings_get_for_screen(gdk_screen_get_default()),
|
|
||||||
s_sizes[i].icon,
|
|
||||||
&s_sizes[i].x, &s_sizes[i].y);
|
|
||||||
else
|
|
||||||
#else // pre-GTK 2.2
|
|
||||||
{
|
|
||||||
// FIXME
|
|
||||||
gtk_icon_size_lookup(s_sizes[i].icon,
|
|
||||||
&s_sizes[i].x, &s_sizes[i].y);
|
&s_sizes[i].x, &s_sizes[i].y);
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
s_sizesInitialized = true;
|
s_sizesInitialized = true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user