]> git.saurik.com Git - wxWidgets.git/commitdiff
Declare gtk_icon_size_lookup if it is missing from the GTK+ headers (Bug 1177079)
authorMichael Wetherell <mike.wetherell@ntlworld.com>
Fri, 10 Jun 2005 12:04:15 +0000 (12:04 +0000)
committerMichael Wetherell <mike.wetherell@ntlworld.com>
Fri, 10 Jun 2005 12:04:15 +0000 (12:04 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34629 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

configure
configure.in
include/wx/gtk/private.h
include/wx/gtk1/private.h
setup.h.in
src/common/artprov.cpp
src/gtk/artgtk.cpp
src/gtk1/artgtk.cpp

index 99bc2767cf464aa73d791c7d7830dbb79ae29033..1b3409e75281da8561bc51457d668659e2dc0115 100755 (executable)
--- a/configure
+++ b/configure
@@ -25789,7 +25789,7 @@ libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config
             save_CFLAGS="$CFLAGS"
             save_LIBS="$LIBS"
             CFLAGS="$CFLAGS $wx_cv_cflags_gtk"
             save_CFLAGS="$CFLAGS"
             save_LIBS="$LIBS"
             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
 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 $ECHO_N "checking if GTK+ is version >= 2.4... $ECHO_C" >&6
             cat >conftest.$ac_ext <<_ACEOF
                         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
             cat >conftest.$ac_ext <<_ACEOF
@@ -30145,7 +30207,11 @@ if test "$cross_compiling" = "yes"; then
 fi
 
 WX_LIBRARY_BASENAME_NOGUI="wx_base${WXBASEPORT}${lib_unicode_suffix}${lib_debug_suffix}${WX_LIB_FLAVOUR}"
 fi
 
 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
index 56d6d431b80c8d639bfbc5ce13a2af4cda26c955..1ed4c4bcd81217524ea1d468ec78156dc3039b3b 100644 (file)
@@ -2724,6 +2724,25 @@ libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config
             LIBS="$LIBS $wx_cv_libs_gtk"
             
             AC_CHECK_FUNCS([pango_font_family_is_monospace])
             LIBS="$LIBS $wx_cv_libs_gtk"
             
             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:
             AC_MSG_CHECKING([if GTK+ is version >= 2.4])
             
             dnl test if we have at least GTK+ 2.4:
             AC_MSG_CHECKING([if GTK+ is version >= 2.4])
index 9f4cd54c02a2a3a106cbdb9751001887b3fdb81b..c943f3ad2da97c782db64d6ac1e14eeede061027 100644 (file)
@@ -136,5 +136,14 @@ inline wxEventType GtkScrollWinTypeToWx(guint scrollType)
 wxString wxEscapeStringForPangoMarkup(const wxString& str);
 #endif
 
 wxString wxEscapeStringForPangoMarkup(const wxString& str);
 #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_
 
index 9f4cd54c02a2a3a106cbdb9751001887b3fdb81b..c943f3ad2da97c782db64d6ac1e14eeede061027 100644 (file)
@@ -136,5 +136,14 @@ inline wxEventType GtkScrollWinTypeToWx(guint scrollType)
 wxString wxEscapeStringForPangoMarkup(const wxString& str);
 #endif
 
 wxString wxEscapeStringForPangoMarkup(const wxString& str);
 #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_
 
index 381af0754b2d5857b6eb1c41598d347de50d7573..9c9f72c60dcb52fc7e772a346b9f8d45945b3932 100644 (file)
 /* Define if you have pango_font_family_is_monospace() (Pango >= 1.3.3) */
 #undef HAVE_PANGO_FONT_FAMILY_IS_MONOSPACE
 
 /* Define if you have pango_font_family_is_monospace() (Pango >= 1.3.3) */
 #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 */
 #undef HAVE_PANGO_XFT
 
 /* Define if you have Pango xft support */
 #undef HAVE_PANGO_XFT
 
index 4657066f9952b0232c05ea8401945b19bfb61009..c0c91304cb05401d333b8d65d0554afb28336f9e 100644 (file)
@@ -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);
 #endif // defined(__WXGTK20__) && !defined(__WXUNIVERSAL__)
 
     extern GtkIconSize wxArtClientToIconSize(const wxArtClient& client);
 #endif // defined(__WXGTK20__) && !defined(__WXUNIVERSAL__)
 
index 6b401aee0918b15c882e8647308dad9d112f2ee7..0956482251d2062fd2fd9b402e52006e82f6299b 100644 (file)
@@ -24,6 +24,7 @@
 
 #include "wx/artprov.h"
 #include "wx/module.h"
 
 #include "wx/artprov.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;
         for (size_t i = 0; i < NUM_SIZES; i++)
         {
         s_sizes[5].icon = GTK_ICON_SIZE_DIALOG;
         for (size_t i = 0; i < NUM_SIZES; i++)
         {
-#if !defined(GDK_MULTITHREAD_SAFE)
-            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,
+            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;
     }
index 6b401aee0918b15c882e8647308dad9d112f2ee7..0956482251d2062fd2fd9b402e52006e82f6299b 100644 (file)
@@ -24,6 +24,7 @@
 
 #include "wx/artprov.h"
 #include "wx/module.h"
 
 #include "wx/artprov.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;
         for (size_t i = 0; i < NUM_SIZES; i++)
         {
         s_sizes[5].icon = GTK_ICON_SIZE_DIALOG;
         for (size_t i = 0; i < NUM_SIZES; i++)
         {
-#if !defined(GDK_MULTITHREAD_SAFE)
-            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,
+            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;
     }