2011-06-16 Carlos Garcia Campos <cgarcia@igalia.com>
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 16 Jun 2011 15:39:54 +0000 (15:39 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 16 Jun 2011 15:39:54 +0000 (15:39 +0000)
        Reviewed by Xan Lopez.

        [GTK] Remove support for GTK+2 in WebKit2
        https://bugs.webkit.org/show_bug.cgi?id=62794

        * configure.ac: Make WebKit2 require GTK+ 3.x.
2011-06-16  Carlos Garcia Campos  <cgarcia@igalia.com>

        Reviewed by Xan Lopez.

        [GTK] Remove support for GTK+2 in WebKit2
        https://bugs.webkit.org/show_bug.cgi?id=62794

        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
        (webkitWebViewBaseRealize):
        (webkitWebViewBaseDraw):
        (webkitWebViewBaseQueryTooltip):
        (webkit_web_view_base_class_init):
        (webkitWebViewBaseSetTooltipText):
        * UIProcess/gtk/WebContextMenuProxyGtk.cpp:
        (WebKit::WebContextMenuProxyGtk::menuPositionFunction):
        * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
        (WebKit::moduleMixesGtkSymbols):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@89028 268f45cc-cd09-0410-ab3c-d52691b4dbfc

ChangeLog
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp
Source/WebKit2/UIProcess/gtk/WebContextMenuProxyGtk.cpp
Source/WebKit2/WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp
configure.ac

index 07cc5ca..00a3b23 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2011-06-16  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        Reviewed by Xan Lopez.
+
+        [GTK] Remove support for GTK+2 in WebKit2
+        https://bugs.webkit.org/show_bug.cgi?id=62794
+
+        * configure.ac: Make WebKit2 require GTK+ 3.x.
+
 2011-06-15  Ryuan Choi  <ryuan.choi@samsung.com>
 
         Rubber stamped by Eric Seidel.
index dae1f52..932a3d8 100644 (file)
@@ -1,3 +1,21 @@
+2011-06-16  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        Reviewed by Xan Lopez.
+
+        [GTK] Remove support for GTK+2 in WebKit2
+        https://bugs.webkit.org/show_bug.cgi?id=62794
+
+        * UIProcess/API/gtk/WebKitWebViewBase.cpp:
+        (webkitWebViewBaseRealize):
+        (webkitWebViewBaseDraw):
+        (webkitWebViewBaseQueryTooltip):
+        (webkit_web_view_base_class_init):
+        (webkitWebViewBaseSetTooltipText):
+        * UIProcess/gtk/WebContextMenuProxyGtk.cpp:
+        (WebKit::WebContextMenuProxyGtk::menuPositionFunction):
+        * WebProcess/Plugins/Netscape/x11/NetscapePluginX11.cpp:
+        (WebKit::moduleMixesGtkSymbols):
+
 2011-06-15  Adam Barth  <abarth@webkit.org>
 
         Reviewed by Eric Seidel.
index b773e70..43eba3e 100644 (file)
@@ -75,9 +75,6 @@ static void webkitWebViewBaseRealize(GtkWidget* widget)
     attributes.height = allocation.height;
     attributes.wclass = GDK_INPUT_OUTPUT;
     attributes.visual = gtk_widget_get_visual(widget);
-#ifdef GTK_API_VERSION_2
-    attributes.colormap = gtk_widget_get_colormap(widget);
-#endif
     attributes.event_mask = GDK_VISIBILITY_NOTIFY_MASK
         | GDK_EXPOSURE_MASK
         | GDK_BUTTON_PRESS_MASK
@@ -91,23 +88,12 @@ static void webkitWebViewBaseRealize(GtkWidget* widget)
         | GDK_BUTTON3_MOTION_MASK;
 
     gint attributesMask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
-#ifdef GTK_API_VERSION_2
-    attributesMask |= GDK_WA_COLORMAP;
-#endif
+
     GdkWindow* window = gdk_window_new(gtk_widget_get_parent_window(widget), &attributes, attributesMask);
     gtk_widget_set_window(widget, window);
     gdk_window_set_user_data(window, widget);
 
-#ifdef GTK_API_VERSION_2
-#if GTK_CHECK_VERSION(2, 20, 0)
-    gtk_widget_style_attach(widget);
-#else
-    widget->style = gtk_style_attach(gtk_widget_get_style(widget), window);
-#endif
-    gtk_style_set_background(gtk_widget_get_style(widget), window, GTK_STATE_NORMAL);
-#else
     gtk_style_context_set_background(gtk_widget_get_style_context(widget), window);
-#endif
 
     WebKitWebViewBase* webView = WEBKIT_WEB_VIEW_BASE(widget);
     WebKitWebViewBasePrivate* priv = webView->priv;
@@ -150,36 +136,21 @@ static void webkit_web_view_base_init(WebKitWebViewBase* webkitWebViewBase)
     priv->pageClient = PageClientImpl::create(GTK_WIDGET(webkitWebViewBase));
 }
 
-static void callDrawingAreaPaintMethod(DrawingAreaProxy* drawingArea, cairo_t* context, const IntRect& area)
+static gboolean webkitWebViewBaseDraw(GtkWidget* widget, cairo_t* cr)
 {
+    DrawingAreaProxy* drawingArea = WEBKIT_WEB_VIEW_BASE(widget)->priv->pageProxy->drawingArea();
     if (!drawingArea)
-        return;
-
-    WebKit::Region unpaintedRegion; // This is simply unused.
-    static_cast<DrawingAreaProxyImpl*>(drawingArea)->paint(context, area, unpaintedRegion);
-}
-
-#ifdef GTK_API_VERSION_2
-static gboolean webkitWebViewBaseExpose(GtkWidget* widget, GdkEventExpose* event)
-{
-    GdkRectangle clipRect;
-    gdk_region_get_clipbox(event->region, &clipRect);
+        return FALSE;
 
-    RefPtr<cairo_t> cr = adoptRef(gdk_cairo_create(gtk_widget_get_window(widget)));
-    callDrawingAreaPaintMethod(WEBKIT_WEB_VIEW_BASE(widget)->priv->pageProxy->drawingArea(), cr.get(), clipRect);
-    return FALSE;
-}
-#else
-static gboolean webkitWebViewBaseDraw(GtkWidget* widget, cairo_t* cr)
-{
     GdkRectangle clipRect;
     if (!gdk_cairo_get_clip_rectangle(cr, &clipRect))
         return FALSE;
 
-    callDrawingAreaPaintMethod(WEBKIT_WEB_VIEW_BASE(widget)->priv->pageProxy->drawingArea(), cr, clipRect);
+    WebKit::Region unpaintedRegion; // This is simply unused.
+    static_cast<DrawingAreaProxyImpl*>(drawingArea)->paint(cr, clipRect, unpaintedRegion);
+
     return FALSE;
 }
-#endif
 
 static void webkitWebViewBaseSizeAllocate(GtkWidget* widget, GtkAllocation* allocation)
 {
@@ -290,7 +261,6 @@ static gboolean webkitWebViewBaseMotionNotifyEvent(GtkWidget* widget, GdkEventMo
     return FALSE;
 }
 
-#if GTK_CHECK_VERSION(2, 12, 0)
 static gboolean webkitWebViewBaseQueryTooltip(GtkWidget* widget, gint x, gint y, gboolean keyboardMode, GtkTooltip* tooltip)
 {
     WebKitWebViewBasePrivate* priv = WEBKIT_WEB_VIEW_BASE(widget)->priv;
@@ -309,17 +279,12 @@ static gboolean webkitWebViewBaseQueryTooltip(GtkWidget* widget, gint x, gint y,
     gtk_tooltip_set_text(tooltip, priv->tooltipText.data());
     return TRUE;
 }
-#endif
 
 static void webkit_web_view_base_class_init(WebKitWebViewBaseClass* webkitWebViewBaseClass)
 {
     GtkWidgetClass* widgetClass = GTK_WIDGET_CLASS(webkitWebViewBaseClass);
     widgetClass->realize = webkitWebViewBaseRealize;
-#ifdef GTK_API_VERSION_2
-    widgetClass->expose_event = webkitWebViewBaseExpose;
-#else
     widgetClass->draw = webkitWebViewBaseDraw;
-#endif
     widgetClass->size_allocate = webkitWebViewBaseSizeAllocate;
     widgetClass->focus_in_event = webkitWebViewBaseFocusInEvent;
     widgetClass->focus_out_event = webkitWebViewBaseFocusOutEvent;
@@ -329,9 +294,7 @@ static void webkit_web_view_base_class_init(WebKitWebViewBaseClass* webkitWebVie
     widgetClass->button_release_event = webkitWebViewBaseButtonReleaseEvent;
     widgetClass->scroll_event = webkitWebViewBaseScrollEvent;
     widgetClass->motion_notify_event = webkitWebViewBaseMotionNotifyEvent;
-#if GTK_CHECK_VERSION(2, 12, 0)
     widgetClass->query_tooltip = webkitWebViewBaseQueryTooltip;
-#endif
 
     GObjectClass* gobjectClass = G_OBJECT_CLASS(webkitWebViewBaseClass);
     gobjectClass->finalize = webkitWebViewBaseFinalize;
@@ -367,7 +330,6 @@ void webkitWebViewBaseCreateWebPage(WebKitWebViewBase* webkitWebViewBase, WKCont
 
 void webkitWebViewBaseSetTooltipText(WebKitWebViewBase* webViewBase, const char* tooltip)
 {
-#if GTK_CHECK_VERSION(2, 12, 0)
     WebKitWebViewBasePrivate* priv = webViewBase->priv;
     if (tooltip && tooltip[0] != '\0') {
         priv->tooltipText = tooltip;
@@ -378,11 +340,6 @@ void webkitWebViewBaseSetTooltipText(WebKitWebViewBase* webViewBase, const char*
     }
 
     gtk_widget_trigger_tooltip_query(GTK_WIDGET(webViewBase));
-#else
-    // TODO: Support older GTK+ versions
-    // See http://bugs.webkit.org/show_bug.cgi?id=15793
-    notImplemented();
-#endif
 }
 
 
index 0b14430..85ddb37 100644 (file)
@@ -105,11 +105,7 @@ WebContextMenuProxyGtk::~WebContextMenuProxyGtk()
 void WebContextMenuProxyGtk::menuPositionFunction(GtkMenu* menu, gint* x, gint* y, gboolean* pushIn, WebContextMenuProxyGtk* popupMenu)
 {
     GtkRequisition menuSize;
-#ifdef GTK_API_VERSION_2
-    gtk_widget_size_request(GTK_WIDGET(menu), &menuSize);
-#else
     gtk_widget_get_preferred_size(GTK_WIDGET(menu), &menuSize, 0);
-#endif
 
     GdkScreen* screen = gtk_widget_get_screen(popupMenu->m_webView);
     *x = popupMenu->m_popupPosition.x();
index 5fddb7f..22c1779 100644 (file)
@@ -134,11 +134,7 @@ static inline int x11Screen()
 #if PLATFORM(GTK)
 static bool moduleMixesGtkSymbols(Module* module)
 {
-#ifdef GTK_API_VERSION_2
-    return module->functionPointer<gpointer>("gtk_application_get_type");
-#else
     return module->functionPointer<gpointer>("gtk_object_get_type");
-#endif
 }
 #endif
 
index 47250ad..b55fbef 100644 (file)
@@ -1060,6 +1060,11 @@ AC_ARG_ENABLE(webkit2,
                 [build webkit2 [default=no]]),
                 [], [enable_webkit2="no"])
 AC_MSG_RESULT([$enable_webkit2])
+if test "$enable_webkit2" = "yes"; then
+   if test "$GTK_API_VERSION" = "2.0"; then
+      AC_MSG_ERROR([WebKit2 requires GTK+ 3.x, use --with-gtk=3.0])
+   fi
+fi
 
 # Plugin Process
 AC_MSG_CHECKING([whether to build plugin process for WebKit2])