2009-04-03 Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk>
authorkov@webkit.org <kov@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 3 Apr 2009 13:00:35 +0000 (13:00 +0000)
committerkov@webkit.org <kov@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 3 Apr 2009 13:00:35 +0000 (13:00 +0000)
        Reviewed by Holger Freyther.

        Require GTK+ >= 2.10; 2.8 is already very old, and some very
        useful APIs are only available since 2.10.

        * configure.ac:

WebCore/

2009-04-03  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>

        Reviewed by Holger Freyther.

        Remove pre-processor checks for GTK+ >= 2.10, since we now require
        at least that version.

        * platform/graphics/gtk/FontPlatformDataGtk.cpp:
        (WebCore::FontPlatformData::FontPlatformData):
        * platform/gtk/ContextMenuItemGtk.cpp:
        (WebCore::gtkStockIDFromContextMenuAction):
        * platform/gtk/KeyEventGtk.cpp:
        (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
        * platform/gtk/LocalizedStringsGtk.cpp:
        (WebCore::contextMenuItemTagSelectAll):
        * platform/gtk/MouseEventGtk.cpp:
        (WebCore::PlatformMouseEvent::PlatformMouseEvent):
        * platform/gtk/PasteboardGtk.cpp:
        (WebCore::Pasteboard::writeSelection):
        (WebCore::Pasteboard::documentFragment):
        * platform/gtk/WheelEventGtk.cpp:
        (WebCore::PlatformWheelEvent::PlatformWheelEvent):

WebKit/gtk

2009-04-03  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>

        Reviewed by Holger Freyther.

        Remove pre-processor checks for GTK+ >= 2.10, since we now require
        at least that version.

        * WebCoreSupport/EditorClientGtk.cpp:
        (WebKit::clipboard_clear_contents_cb):
        (WebKit::EditorClient::respondToChangedSelection):
        * webkit/webkitwebframe.cpp:
        * webkit/webkitwebview.cpp:

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

14 files changed:
ChangeLog
WebCore/ChangeLog
WebCore/platform/graphics/gtk/FontPlatformDataGtk.cpp
WebCore/platform/gtk/ContextMenuItemGtk.cpp
WebCore/platform/gtk/KeyEventGtk.cpp
WebCore/platform/gtk/LocalizedStringsGtk.cpp
WebCore/platform/gtk/MouseEventGtk.cpp
WebCore/platform/gtk/PasteboardGtk.cpp
WebCore/platform/gtk/WheelEventGtk.cpp
WebKit/gtk/ChangeLog
WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp
WebKit/gtk/webkit/webkitwebframe.cpp
WebKit/gtk/webkit/webkitwebview.cpp
configure.ac

index bfe5e35..ba46612 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2009-04-03  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
+
+        Reviewed by Holger Freyther.
+
+        Require GTK+ >= 2.10; 2.8 is already very old, and some very
+        useful APIs are only available since 2.10.
+
+        * configure.ac:
+
 2009-04-01  Christian Dywan  <christian@twotoasts.de>
 
         Reviewed by Holger Freyther.
index ac47765..e0402eb 100644 (file)
@@ -1,3 +1,26 @@
+2009-04-03  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
+
+        Reviewed by Holger Freyther.
+
+        Remove pre-processor checks for GTK+ >= 2.10, since we now require
+        at least that version.
+
+        * platform/graphics/gtk/FontPlatformDataGtk.cpp:
+        (WebCore::FontPlatformData::FontPlatformData):
+        * platform/gtk/ContextMenuItemGtk.cpp:
+        (WebCore::gtkStockIDFromContextMenuAction):
+        * platform/gtk/KeyEventGtk.cpp:
+        (WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
+        * platform/gtk/LocalizedStringsGtk.cpp:
+        (WebCore::contextMenuItemTagSelectAll):
+        * platform/gtk/MouseEventGtk.cpp:
+        (WebCore::PlatformMouseEvent::PlatformMouseEvent):
+        * platform/gtk/PasteboardGtk.cpp:
+        (WebCore::Pasteboard::writeSelection):
+        (WebCore::Pasteboard::documentFragment):
+        * platform/gtk/WheelEventGtk.cpp:
+        (WebCore::PlatformWheelEvent::PlatformWheelEvent):
+
 2009-04-02  Simon Fraser  <simon.fraser@apple.com>
 
         Reviewed by Dan Bernstein
index 68685e9..f0f0dd5 100644 (file)
@@ -109,10 +109,9 @@ FontPlatformData::FontPlatformData(const FontDescription& fontDescription, const
     cairo_matrix_init_scale(&fontMatrix, fontDescription.computedPixelSize(), fontDescription.computedPixelSize());
     cairo_matrix_init_identity(&ctm);
 
-#if GTK_CHECK_VERSION(2,10,0)
     if (GdkScreen* screen = gdk_screen_get_default())
         options = gdk_screen_get_font_options(screen);
-#endif
+
     // gdk_screen_get_font_options() returns NULL if no default options are
     // set, so we always have to check.
     if (!options)
@@ -150,10 +149,9 @@ FontPlatformData::FontPlatformData(cairo_font_face_t* fontFace, int size, bool b
     static const cairo_font_options_t* defaultOptions = cairo_font_options_create();
     const cairo_font_options_t* options = NULL;
 
-#if GTK_CHECK_VERSION(2,10,0)
     if (GdkScreen* screen = gdk_screen_get_default())
         options = gdk_screen_get_font_options(screen);
-#endif
+
     // gdk_screen_get_font_options() returns NULL if no default options are
     // set, so we always have to check.
     if (!options)
index cf34640..aaec206 100644 (file)
@@ -56,10 +56,8 @@ static const char* gtkStockIDFromContextMenuAction(const ContextMenuAction& acti
         return GTK_STOCK_PASTE;
     case ContextMenuItemTagDelete:
         return GTK_STOCK_DELETE;
-#if GTK_CHECK_VERSION(2, 10, 0)
     case ContextMenuItemTagSelectAll:
         return GTK_STOCK_SELECT_ALL;
-#endif
     case ContextMenuItemTagSpellingGuess:
         return GTK_STOCK_INFO;
     case ContextMenuItemTagIgnoreSpelling:
index e0742f4..fd33765 100644 (file)
@@ -37,9 +37,6 @@
 #include <gdk/gdk.h>
 #include <gdk/gdkkeysyms.h>
 
-// GTK_CHECK_VERSION is defined in gtk/gtkversion.h
-#include <gtk/gtk.h>
-
 namespace WebCore {
 
 // FIXME: This is incomplete.  We should change this to mirror
@@ -536,12 +533,7 @@ PlatformKeyboardEvent::PlatformKeyboardEvent(GdkEventKey* event)
     , m_shiftKey((event->state & GDK_SHIFT_MASK) || (event->keyval == GDK_3270_BackTab))
     , m_ctrlKey(event->state & GDK_CONTROL_MASK)
     , m_altKey(event->state & GDK_MOD1_MASK)
-#if GTK_CHECK_VERSION(2,10,0)
     , m_metaKey(event->state & GDK_META_MASK)
-#else
-    // GDK_MOD2_MASK doesn't always mean meta so we can't use it
-    , m_metaKey(false)
-#endif
     , m_gdkEventKey(event)
 {
 }
index 52d4f5f..195122a 100644 (file)
@@ -125,11 +125,7 @@ String contextMenuItemTagDelete()
 
 String contextMenuItemTagSelectAll()
 {
-#if GTK_CHECK_VERSION(2,10,0)
     static String stockLabel = String::fromUTF8(gtkStockLabel(GTK_STOCK_SELECT_ALL));
-#else
-    static String stockLabel = String::fromUTF8(_("Select _All"));
-#endif
     return stockLabel;
 }
 
index 2400ebf..69f938f 100644 (file)
@@ -31,9 +31,6 @@
 
 #include <gdk/gdk.h>
 
-// GTK_CHECK_VERSION is defined in gtk/gtkversion.h
-#include <gtk/gtk.h>
-
 namespace WebCore {
 
 // FIXME: Would be even better to figure out which modifier is Alt instead of always using GDK_MOD1_MASK.
@@ -47,12 +44,7 @@ PlatformMouseEvent::PlatformMouseEvent(GdkEventButton* event)
     m_shiftKey = event->state & GDK_SHIFT_MASK;
     m_ctrlKey = event->state & GDK_CONTROL_MASK;
     m_altKey = event->state & GDK_MOD1_MASK;
-#if GTK_CHECK_VERSION(2,10,0)
     m_metaKey = event->state & GDK_META_MASK;
-#else
-    // GDK_MOD2_MASK doesn't always mean meta so we can't use it
-    m_metaKey = false;
-#endif
 
     switch (event->type) {
     case GDK_BUTTON_PRESS:
index 15a7e64..c604c37 100644 (file)
@@ -103,7 +103,6 @@ void Pasteboard::setHelper(PasteboardHelper* helper)
 void Pasteboard::writeSelection(Range* selectedRange, bool canSmartCopyOrDelete, Frame* frame)
 {
     GtkClipboard* clipboard = m_helper->getClipboard(frame);
-#if GTK_CHECK_VERSION(2,10,0)
     gchar* text = g_strdup(frame->selectedText().utf8().data());
     gchar* markup = g_strdup(createMarkup(selectedRange, 0, AnnotateForInterchange).utf8().data());
     PasteboardSelectionData* data = new PasteboardSelectionData(text, markup);
@@ -113,9 +112,6 @@ void Pasteboard::writeSelection(Range* selectedRange, bool canSmartCopyOrDelete,
     gtk_clipboard_set_with_data(clipboard, targets, n_targets,
                                 clipboard_get_contents_cb, clipboard_clear_contents_cb, data);
     gtk_target_table_free(targets, n_targets);
-#else
-    gtk_clipboard_set_text(clipboard, frame->selectedText().utf8().data(), frame->selectedText().utf8().length());
-#endif
 }
 
 void Pasteboard::writeURL(const KURL& url, const String&, Frame* frame)
@@ -163,11 +159,7 @@ bool Pasteboard::canSmartReplace()
 PassRefPtr<DocumentFragment> Pasteboard::documentFragment(Frame* frame, PassRefPtr<Range> context,
                                                           bool allowPlainText, bool& chosePlainText)
 {
-#if GTK_CHECK_VERSION(2,10,0)
     GdkAtom textHtml = gdk_atom_intern_static_string("text/html");
-#else
-    GdkAtom textHtml = gdk_atom_intern("text/html", false);
-#endif
     GtkClipboard* clipboard = m_helper->getClipboard(frame);
     chosePlainText = false;
 
index 075bed2..404bf29 100644 (file)
@@ -31,9 +31,6 @@
 
 #include <gdk/gdk.h>
 
-// GTK_CHECK_VERSION is defined in gtk/gtkversion.h
-#include <gtk/gtk.h>
-
 namespace WebCore {
 
 // Keep this in sync with the other platform event constructors
@@ -69,12 +66,7 @@ PlatformWheelEvent::PlatformWheelEvent(GdkEventScroll* event)
     m_shiftKey = event->state & GDK_SHIFT_MASK;
     m_ctrlKey = event->state & GDK_CONTROL_MASK;
     m_altKey = event->state & GDK_MOD1_MASK;
-#if GTK_CHECK_VERSION(2,10,0)
     m_metaKey = event->state & GDK_META_MASK;
-#else
-    // GDK_MOD2_MASK doesn't always mean meta so we can't use it
-    m_metaKey = false;
-#endif
 
     // FIXME: retrieve the user setting for the number of lines to scroll on each wheel event
     m_deltaX *= static_cast<float>(cScrollbarPixelsPerLineStep);
index 87634cb..912513c 100644 (file)
@@ -1,3 +1,16 @@
+2009-04-03  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
+
+        Reviewed by Holger Freyther.
+
+        Remove pre-processor checks for GTK+ >= 2.10, since we now require
+        at least that version.
+
+        * WebCoreSupport/EditorClientGtk.cpp:
+        (WebKit::clipboard_clear_contents_cb):
+        (WebKit::EditorClient::respondToChangedSelection):
+        * webkit/webkitwebframe.cpp:
+        * webkit/webkitwebview.cpp:
+
 2009-04-02  Gustavo Noronha Silva  <gustavo.noronha@collabora.co.uk>
 
         Reviewed by Alexey  Proskuryakov.
index a1f2509..c2d37ae 100644 (file)
@@ -164,7 +164,6 @@ void EditorClient::respondToChangedContents()
     notImplemented();
 }
 
-#if GTK_CHECK_VERSION(2,10,0)
 static void clipboard_get_contents_cb(GtkClipboard* clipboard, GtkSelectionData* selection_data, guint info, gpointer data)
 {
     WebKitWebView* webView = reinterpret_cast<WebKitWebView*>(data);
@@ -189,7 +188,6 @@ static void clipboard_clear_contents_cb(GtkClipboard* clipboard, gpointer data)
     // Collapse the selection without clearing it
     frame->selection()->setBase(frame->selection()->extent(), frame->selection()->affinity());
 }
-#endif
 
 void EditorClient::respondToChangedSelection()
 {
@@ -202,7 +200,6 @@ void EditorClient::respondToChangedSelection()
     if (targetFrame->editor()->ignoreCompositionSelectionChange())
         return;
 
-#if GTK_CHECK_VERSION(2,10,0)
     GtkClipboard* clipboard = gtk_widget_get_clipboard(GTK_WIDGET(m_webView), GDK_SELECTION_PRIMARY);
     if (targetFrame->selection()->isRange()) {
         GtkTargetList* targetList = webkit_web_view_get_copy_target_list(m_webView);
@@ -213,7 +210,6 @@ void EditorClient::respondToChangedSelection()
         gtk_target_table_free(targets, targetCount);
     } else if (gtk_clipboard_get_owner(clipboard) == G_OBJECT(m_webView))
         gtk_clipboard_clear(clipboard);
-#endif
 
     if (!targetFrame->editor()->hasComposition())
         return;
index e2b10b6..029e016 100644 (file)
@@ -610,8 +610,6 @@ gchar* webkit_web_frame_dump_render_tree(WebKitWebFrame* frame)
     return g_strdup(string.utf8().data());
 }
 
-#if GTK_CHECK_VERSION(2,10,0)
-
 static void begin_print(GtkPrintOperation* op, GtkPrintContext* context, gpointer user_data)
 {
     PrintContext* printContext = reinterpret_cast<PrintContext*>(user_data);
@@ -679,15 +677,6 @@ void webkit_web_frame_print(WebKitWebFrame* frame)
     }
 }
 
-#else
-
-void webkit_web_frame_print(WebKitWebFrame*)
-{
-    g_warning("Printing support is not available in older versions of GTK+");
-}
-
-#endif
-
 bool webkit_web_frame_pause_animation(WebKitWebFrame* frame, const gchar* name, double time, const gchar* element)
 {
     ASSERT(core(frame));
index cd020a8..796d866 100644 (file)
@@ -291,14 +291,12 @@ static void webkit_web_view_get_property(GObject* object, guint prop_id, GValue*
     case PROP_URI:
         g_value_set_string(value, webkit_web_view_get_uri(webView));
         break;
-#if GTK_CHECK_VERSION(2,10,0)
     case PROP_COPY_TARGET_LIST:
         g_value_set_boxed(value, webkit_web_view_get_copy_target_list(webView));
         break;
     case PROP_PASTE_TARGET_LIST:
         g_value_set_boxed(value, webkit_web_view_get_paste_target_list(webView));
         break;
-#endif
     case PROP_EDITABLE:
         g_value_set_boolean(value, webkit_web_view_get_editable(webView));
         break;
@@ -1683,7 +1681,6 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass)
                                                         NULL,
                                                         WEBKIT_PARAM_READABLE));
 
-#if GTK_CHECK_VERSION(2,10,0)
     /**
     * WebKitWebView:copy-target-list:
     *
@@ -1711,7 +1708,6 @@ static void webkit_web_view_class_init(WebKitWebViewClass* webViewClass)
                                                        "The list of targets this web view supports for clipboard pasting",
                                                        GTK_TYPE_TARGET_LIST,
                                                        WEBKIT_PARAM_READABLE));
-#endif
 
     g_object_class_install_property(objectClass, PROP_SETTINGS,
                                     g_param_spec_object("settings",
@@ -1833,7 +1829,6 @@ static gdouble webViewGetDPI(WebKitWebView* webView)
         return 96.0;
 
     gdouble DPI = defaultDPI;
-#if GTK_CHECK_VERSION(2,10,0)
     GdkScreen* screen = gtk_widget_has_screen(GTK_WIDGET(webView)) ? gtk_widget_get_screen(GTK_WIDGET(webView)) : gdk_screen_get_default();
     if (screen) {
         DPI = gdk_screen_get_resolution(screen);
@@ -1841,7 +1836,6 @@ static gdouble webViewGetDPI(WebKitWebView* webView)
         if (DPI == -1)
             DPI = defaultDPI;
     }
-#endif
     ASSERT(DPI > 0);
     return DPI;
 }
@@ -2019,11 +2013,7 @@ static void webkit_web_view_init(WebKitWebView* webView)
 
     priv->zoomFullContent = FALSE;
 
-#if GTK_CHECK_VERSION(2,10,0)
     GdkAtom textHtml = gdk_atom_intern_static_string("text/html");
-#else
-    GdkAtom textHtml = gdk_atom_intern("text/html", false);
-#endif
     /* Targets for copy */
     priv->copy_target_list = gtk_target_list_new(NULL, 0);
     gtk_target_list_add(priv->copy_target_list, textHtml, 0, WEBKIT_WEB_VIEW_TARGET_INFO_HTML);
index 37349f3..1366516 100644 (file)
@@ -183,7 +183,7 @@ LIBXML_REQUIRED_VERSION=2.6
 
 # minimum GTK+ base dependencies
 PANGO_REQUIRED_VERSION=1.0
-GTK_REQUIRED_VERSION=2.8
+GTK_REQUIRED_VERSION=2.10
 
 # optional modules
 LIBSOUP_REQUIRED_VERSION=2.25.91