]> git.saurik.com Git - wxWidgets.git/commitdiff
Fix the build system in gtk, plus a couple of compilation errors. wxWebView now succe...
authorSteve Lamerton <steve.lamerton@gmail.com>
Tue, 28 Jun 2011 15:15:51 +0000 (15:15 +0000)
committerSteve Lamerton <steve.lamerton@gmail.com>
Tue, 28 Jun 2011 15:15:51 +0000 (15:15 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/SOC2011_WEBVIEW@68072 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

configure.in
src/common/webview.cpp
src/gtk/webview_webkit.cpp

index 11a830dc423262bfd6b9fcd18360834318836efc..6d058ba4774da0aceed167c0b7c8388eb6794587 100644 (file)
@@ -7348,6 +7348,44 @@ if test "$wxUSE_WEB" = "yes"; then
    AC_DEFINE(wxUSE_WEB)
    USE_WEB=1
    SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS web"
+
+   if test "$wxUSE_WEBVIEW_WEBKIT" = "yes" -a "$wxUSE_GTK" = 1; then
+       AC_DEFINE(wxUSE_WEBVIEW_WEBKIT)
+       AC_MSG_CHECKING([for webkitgtk libraries])
+       WX_PATH_FIND_LIBRARIES([$SEARCH_LIB],webkitgtk-1.0)
+       if test "$ac_find_libraries" != "" ; then
+           WX_LINK_PATH_EXIST([$ac_find_libraries],[$LDFLAGS])
+           if test "$ac_path_to_link" != " -L/usr/lib" ; then
+               LDFLAGS="$LDFLAGS $ac_path_to_link"
+           fi
+           GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lwebkitgtk-1.0"
+           AC_MSG_RESULT([yes])
+       else
+           AC_MSG_RESULT([no])
+           AC_MSG_WARN([libwebkitgtk-1.0 not found; disabling webkit backend])
+           wxUSE_WEBVIEW_WEBKIT="no"
+       fi
+
+       AC_MSG_CHECKING(for webkitgtk includes)
+       WX_PATH_FIND_INCLUDES([$SEARCH_INCLUDE /usr/include/webkit-1.0], webkit/webkit.h)
+       if test "$ac_find_includes" != "" ; then
+           AC_MSG_RESULT(found in $ac_find_includes)
+           WX_INCLUDE_PATH_EXIST($ac_find_includes, $CPPFLAGS)
+           CPPFLAGS="$ac_path_to_include $CPPFLAGS"
+       else
+           AC_MSG_RESULT([not found])
+       fi
+       dnl we also depend on libsoup
+       AC_MSG_CHECKING(for libsoup includes)
+       WX_PATH_FIND_INCLUDES([$SEARCH_INCLUDE /usr/include/libsoup-2.4], libsoup/soup.h)
+       if test "$ac_find_includes" != "" ; then
+           AC_MSG_RESULT(found in $ac_find_includes)
+           WX_INCLUDE_PATH_EXIST($ac_find_includes, $CPPFLAGS)
+           CPPFLAGS="$ac_path_to_include $CPPFLAGS"
+       else
+           AC_MSG_RESULT([not found])
+       fi
+   fi
 fi
 
 dnl ---------------------------------------------------------------------------
index f575b5460b1c8a97dbd72668875f04f2a6c13d99..484488faa4fc4d1c55648c74d7846817cef10834 100644 (file)
@@ -42,32 +42,32 @@ wxWebView* wxWebView::New(wxWebViewBackend backend)
 {
     switch (backend)
     {
-        #if wxHAVE_WEB_BACKEND_OSX_WEBKIT
+        #if defined(wxUSE_WEBVIEW_WEBKIT) && defined(__WXOSX__)
             case wxWEB_VIEW_BACKEND_OSX_WEBKIT:
                 return new wxOSXWebKitCtrl();
         #endif
 
-        #if wxHAVE_WEB_BACKEND_GTK_WEBKIT
+        #if defined(wxUSE_WEBVIEW_WEBKIT) && defined(__WXGTK__)
             case wxWEB_VIEW_BACKEND_GTK_WEBKIT:
-                return new wxGtkWebKitCtrl();
+                return new wxWebViewGTKWebKit();
         #endif
 
-        #if wxHAVE_WEB_BACKEND_IE
+        #if wxUSE_WEBVIEW_IE
             case wxWEB_VIEW_BACKEND_IE:
                 return new wxWebViewIE();
         #endif
 
         case wxWEB_VIEW_BACKEND_DEFAULT:
 
-            #if wxHAVE_WEB_BACKEND_OSX_WEBKIT
+            #if defined(wxUSE_WEBVIEW_WEBKIT) && defined(__WXOSX__)
             return new wxOSXWebKitCtrl();
             #endif
 
-            #if wxHAVE_WEB_BACKEND_GTK_WEBKIT
-            return new wxGtkWebKitCtrl();
+            #if defined(wxUSE_WEBVIEW_WEBKIT) && defined(__WXGTK__)
+            return new wxWebViewGTKWebKit();
             #endif
 
-            #if wxHAVE_WEB_BACKEND_IE
+            #if wxUSE_WEBVIEW_IE
             return new wxWebViewIE();
             #endif
 
@@ -89,34 +89,34 @@ wxWebView* wxWebView::New(wxWindow* parent,
 {
     switch (backend)
     {
-        #if wxHAVE_WEB_BACKEND_OSX_WEBKIT
+        #if defined(wxUSE_WEBVIEW_WEBKIT) && defined(__WXOSX__)
             case wxWEB_VIEW_BACKEND_OSX_WEBKIT:
                 return new wxOSXWebKitCtrl(parent, id, url, pos, size, style,
                                            name);
         #endif
 
-        #if wxHAVE_WEB_BACKEND_GTK_WEBKIT
+        #if defined(wxUSE_WEBVIEW_WEBKIT) && defined(__WXGTK__)
             case wxWEB_VIEW_BACKEND_GTK_WEBKIT:
-                return new wxGtkWebKitCtrl(parent, id, url, pos, size, style,
+                return new wxWebViewGTKWebKit(parent, id, url, pos, size, style,
                                            name);
         #endif
 
-        #if wxHAVE_WEB_BACKEND_IE
+        #if wxUSE_WEBVIEW_IE
             case wxWEB_VIEW_BACKEND_IE:
                 return new wxWebViewIE(parent, id, url, pos, size, style, name);
         #endif
 
         case wxWEB_VIEW_BACKEND_DEFAULT:
 
-            #if wxHAVE_WEB_BACKEND_OSX_WEBKIT
+            #if defined(wxUSE_WEBVIEW_WEBKIT) && defined(__WXOSX__)
             return new wxOSXWebKitCtrl(parent, id, url, pos, size, style, name);
             #endif
 
-            #if wxHAVE_WEB_BACKEND_GTK_WEBKIT
-            return new wxGtkWebKitCtrl(parent, id, url, pos, size, style, name);
+            #if defined(wxUSE_WEBVIEW_WEBKIT) && defined(__WXGTK__)
+            return new wxWebViewGTKWebKit(parent, id, url, pos, size, style, name);
             #endif
 
-            #if wxHAVE_WEB_BACKEND_IE
+            #if wxUSE_WEBVIEW_IE
             return new wxWebViewIE(parent, id, url, pos, size, style, name);
             #endif
 
index 3fa92ff293ffd925e8b400df5b29b56a14c9f65d..d6d139b83674d5f6e475deb91782be853f996ee2 100644 (file)
@@ -10,8 +10,7 @@
 // For compilers that support precompilation, includes "wx.h".
 #include "wx/wxprec.h"
 
-
-#if wxHAVE_WEB_BACKEND_GTK_WEBKIT
+#if wxUSE_WEBVIEW_WEBKIT
 
 #include "wx/stockitem.h"
 #include "wx/gtk/webview_webkit.h"
@@ -359,7 +358,7 @@ void wxWebViewGTKWebKit::Reload(wxWebViewReloadFlags flags)
 
 void wxWebViewGTKWebKit::LoadUrl(const wxString& url)
 {
-    webkit_web_view_open(WEBKIT_WEB_VIEW(web_view), wxGTK_CONV(loc));
+    webkit_web_view_open(WEBKIT_WEB_VIEW(web_view), wxGTK_CONV(url));
 }