summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/gtk
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2008-10-21 07:00:00 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2008-10-21 07:00:00 -0700
commit9364f22aed35e1a1e9d07c121510f80be3ab0502 (patch)
treed49911209b132da58d838efa852daf28d516df21 /WebCore/platform/gtk
parent87eb0cb35bad8784770ebc807e6c982432e47107 (diff)
downloadexternal_webkit-9364f22aed35e1a1e9d07c121510f80be3ab0502.zip
external_webkit-9364f22aed35e1a1e9d07c121510f80be3ab0502.tar.gz
external_webkit-9364f22aed35e1a1e9d07c121510f80be3ab0502.tar.bz2
Initial Contribution
Diffstat (limited to 'WebCore/platform/gtk')
-rw-r--r--WebCore/platform/gtk/CookieJarGtk.cpp1
-rw-r--r--WebCore/platform/gtk/CursorGtk.cpp1
-rw-r--r--WebCore/platform/gtk/FileChooserGtk.cpp3
-rw-r--r--WebCore/platform/gtk/FileSystemGtk.cpp21
-rw-r--r--WebCore/platform/gtk/KeyEventGtk.cpp25
-rw-r--r--WebCore/platform/gtk/LocalizedStringsGtk.cpp5
-rw-r--r--WebCore/platform/gtk/MainThreadGtk.cpp60
-rw-r--r--WebCore/platform/gtk/MouseEventGtk.cpp9
-rw-r--r--WebCore/platform/gtk/PasteboardGtk.cpp6
-rw-r--r--WebCore/platform/gtk/PopupMenuGtk.cpp3
-rw-r--r--WebCore/platform/gtk/TemporaryLinkStubs.cpp17
-rw-r--r--WebCore/platform/gtk/ThreadingGtk.cpp209
-rw-r--r--WebCore/platform/gtk/WheelEventGtk.cpp9
13 files changed, 227 insertions, 142 deletions
diff --git a/WebCore/platform/gtk/CookieJarGtk.cpp b/WebCore/platform/gtk/CookieJarGtk.cpp
index 2f76ebc..2813a2e 100644
--- a/WebCore/platform/gtk/CookieJarGtk.cpp
+++ b/WebCore/platform/gtk/CookieJarGtk.cpp
@@ -17,6 +17,7 @@
#include "config.h"
#include "CookieJar.h"
+#include "DeprecatedString.h"
#include "KURL.h"
#include "PlatformString.h"
#include "StringHash.h"
diff --git a/WebCore/platform/gtk/CursorGtk.cpp b/WebCore/platform/gtk/CursorGtk.cpp
index 15f492f..94c6975 100644
--- a/WebCore/platform/gtk/CursorGtk.cpp
+++ b/WebCore/platform/gtk/CursorGtk.cpp
@@ -28,6 +28,7 @@
#include "config.h"
#include "CursorGtk.h"
+#include "DeprecatedString.h"
#include "NotImplemented.h"
#include <wtf/Assertions.h>
diff --git a/WebCore/platform/gtk/FileChooserGtk.cpp b/WebCore/platform/gtk/FileChooserGtk.cpp
index 10c1a5f..c41a693 100644
--- a/WebCore/platform/gtk/FileChooserGtk.cpp
+++ b/WebCore/platform/gtk/FileChooserGtk.cpp
@@ -57,8 +57,7 @@ static bool stringByAdoptingFileSystemRepresentation(gchar* systemFilename, Stri
}
FileChooser::FileChooser(FileChooserClient* client, const String& filename)
- : RefCounted<FileChooser>(0)
- , m_client(client)
+ : m_client(client)
, m_filename(filename)
, m_icon(chooseIcon(filename))
{
diff --git a/WebCore/platform/gtk/FileSystemGtk.cpp b/WebCore/platform/gtk/FileSystemGtk.cpp
index df95dde..904fe9f 100644
--- a/WebCore/platform/gtk/FileSystemGtk.cpp
+++ b/WebCore/platform/gtk/FileSystemGtk.cpp
@@ -30,8 +30,6 @@
#include <glib/gstdio.h>
#include <glib/gutils.h>
-#include <unistd.h>
-
namespace WebCore {
bool fileExists(const String& path)
@@ -115,20 +113,6 @@ bool makeAllDirectories(const String& path)
return result == 0;
}
-String homeDirectoryPath()
-{
- return String::fromUTF8(g_get_home_dir());
-}
-
-String pathGetFileName(const String& pathName)
-{
- char* baseName = g_path_get_basename(pathName.utf8().data());
- String fileName = String::fromUTF8(baseName);
- g_free(baseName);
-
- return fileName;
-}
-
CString openTemporaryFile(const char* prefix, PlatformFileHandle& handle)
{
gchar* filename = g_strdup_printf("%sXXXXXX", prefix);
@@ -168,9 +152,4 @@ int writeToFile(PlatformFileHandle handle, const char* data, int length)
return totalBytesWritten;
}
-
-bool unloadModule(PlatformModule module)
-{
- return g_module_close(module);
-}
}
diff --git a/WebCore/platform/gtk/KeyEventGtk.cpp b/WebCore/platform/gtk/KeyEventGtk.cpp
index dea0502..5d2efcf 100644
--- a/WebCore/platform/gtk/KeyEventGtk.cpp
+++ b/WebCore/platform/gtk/KeyEventGtk.cpp
@@ -2,7 +2,6 @@
* Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
* Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com
* Copyright (C) 2007 Holger Hans Peter Freyther
- * Copyright (C) 2008 Collabora, Ltd. All rights reserved.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -30,13 +29,13 @@
#include "config.h"
#include "PlatformKeyboardEvent.h"
+#include "DeprecatedString.h"
#include "KeyboardCodes.h"
#include "NotImplemented.h"
#include "TextEncoding.h"
#include <gdk/gdk.h>
#include <gdk/gdkkeysyms.h>
-#include <gtk/gtkversion.h>
namespace WebCore {
@@ -485,8 +484,6 @@ static String singleCharacterString(guint val)
return retVal;
}
-// Keep this in sync with the other platform event constructors
-// TODO: m_gdkEventKey should be refcounted
PlatformKeyboardEvent::PlatformKeyboardEvent(GdkEventKey* event)
: m_type((event->type == GDK_KEY_RELEASE) ? KeyUp : KeyDown)
, m_text(singleCharacterString(event->keyval))
@@ -494,29 +491,20 @@ PlatformKeyboardEvent::PlatformKeyboardEvent(GdkEventKey* event)
, m_keyIdentifier(keyIdentifierForGdkKeyCode(event->keyval))
, m_autoRepeat(false)
, m_windowsVirtualKeyCode(windowsKeyCodeForKeyEvent(event->keyval))
- , m_isKeypad(event->keyval >= GDK_KP_Space && event->keyval <= GDK_KP_9)
+ , m_isKeypad(false)
, 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)
+ , m_metaKey(event->state & GDK_MOD2_MASK)
{
}
-void PlatformKeyboardEvent::disambiguateKeyDownEvent(Type type, bool backwardCompatibilityMode)
+void PlatformKeyboardEvent::disambiguateKeyDownEvent(Type type, bool)
{
// Can only change type from KeyDown to RawKeyDown or Char, as we lack information for other conversions.
ASSERT(m_type == KeyDown);
m_type = type;
- if (backwardCompatibilityMode)
- return;
-
if (type == RawKeyDown) {
m_text = String();
m_unmodifiedText = String();
@@ -532,9 +520,4 @@ bool PlatformKeyboardEvent::currentCapsLockState()
return false;
}
-GdkEventKey* PlatformKeyboardEvent::gdkEventKey() const
-{
- return m_gdkEventKey;
-}
-
}
diff --git a/WebCore/platform/gtk/LocalizedStringsGtk.cpp b/WebCore/platform/gtk/LocalizedStringsGtk.cpp
index 4be5ba1..041cd83 100644
--- a/WebCore/platform/gtk/LocalizedStringsGtk.cpp
+++ b/WebCore/platform/gtk/LocalizedStringsGtk.cpp
@@ -290,9 +290,4 @@ String unknownFileSizeText()
return String::fromUTF8(_("Unknown"));
}
-String imageTitle(const String& filename, const IntSize& size)
-{
- return String();
-}
-
}
diff --git a/WebCore/platform/gtk/MainThreadGtk.cpp b/WebCore/platform/gtk/MainThreadGtk.cpp
deleted file mode 100644
index db3a583..0000000
--- a/WebCore/platform/gtk/MainThreadGtk.cpp
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
- * Copyright (C) 2007 Justin Haygood (jhaygood@reaktix.com)
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Apple Inc. ("Apple") nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
- * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "MainThread.h"
-
-#include <glib.h>
-
-namespace WebCore {
-
-struct FunctionWithContext {
- MainThreadFunction* function;
- void* context;
-};
-
-static gboolean callFunctionOnMainThread(gpointer data)
-{
- FunctionWithContext* functionWithContext = static_cast<FunctionWithContext*>(data);
- functionWithContext->function(functionWithContext->context);
- delete functionWithContext;
- return FALSE;
-}
-
-void callOnMainThread(MainThreadFunction* function, void* context)
-{
- ASSERT(function);
- FunctionWithContext* functionWithContext = new FunctionWithContext;
- functionWithContext->function = function;
- functionWithContext->context = context;
- g_timeout_add(0, callFunctionOnMainThread, functionWithContext);
-}
-
-
-}
diff --git a/WebCore/platform/gtk/MouseEventGtk.cpp b/WebCore/platform/gtk/MouseEventGtk.cpp
index f441f00..29ea371 100644
--- a/WebCore/platform/gtk/MouseEventGtk.cpp
+++ b/WebCore/platform/gtk/MouseEventGtk.cpp
@@ -31,13 +31,11 @@
#include "Assertions.h"
#include <gdk/gdk.h>
-#include <gtk/gtkversion.h>
namespace WebCore {
// FIXME: Would be even better to figure out which modifier is Alt instead of always using GDK_MOD1_MASK.
-// Keep this in sync with the other platform event constructors
PlatformMouseEvent::PlatformMouseEvent(GdkEventButton* event)
{
m_timestamp = event->time;
@@ -46,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
+ m_metaKey = event->state & GDK_MOD2_MASK;
switch (event->type) {
case GDK_BUTTON_PRESS:
diff --git a/WebCore/platform/gtk/PasteboardGtk.cpp b/WebCore/platform/gtk/PasteboardGtk.cpp
index 15a7e64..745728c 100644
--- a/WebCore/platform/gtk/PasteboardGtk.cpp
+++ b/WebCore/platform/gtk/PasteboardGtk.cpp
@@ -102,20 +102,16 @@ 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);
gint n_targets;
GtkTargetEntry* targets = gtk_target_table_new_from_list(m_helper->getCopyTargetList(frame), &n_targets);
+ GtkClipboard* clipboard = m_helper->getClipboard(frame);
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)
diff --git a/WebCore/platform/gtk/PopupMenuGtk.cpp b/WebCore/platform/gtk/PopupMenuGtk.cpp
index f228c8b..b4689f6 100644
--- a/WebCore/platform/gtk/PopupMenuGtk.cpp
+++ b/WebCore/platform/gtk/PopupMenuGtk.cpp
@@ -33,8 +33,7 @@
namespace WebCore {
PopupMenu::PopupMenu(PopupMenuClient* client)
- : RefCounted<PopupMenu>(0)
- , m_popupClient(client)
+ : m_popupClient(client)
, m_popup(0)
{
}
diff --git a/WebCore/platform/gtk/TemporaryLinkStubs.cpp b/WebCore/platform/gtk/TemporaryLinkStubs.cpp
index 7abe32e..525a6f8 100644
--- a/WebCore/platform/gtk/TemporaryLinkStubs.cpp
+++ b/WebCore/platform/gtk/TemporaryLinkStubs.cpp
@@ -34,8 +34,7 @@
#include "GlobalHistory.h"
#include "KURL.h"
#include "NotImplemented.h"
-#include "PluginDatabase.h"
-#include "PluginPackage.h"
+#include "PluginInfoStore.h"
#include "SharedBuffer.h"
using namespace WebCore;
@@ -60,14 +59,12 @@ Vector<char> loadResourceIntoArray(const char* resourceName)
bool WebCore::historyContains(const UChar*, unsigned) { return false; }
-PluginSet PluginDatabase::getPluginsInPaths() const { notImplemented(); return PluginSet(); }
-Vector<String> PluginDatabase::defaultPluginPaths() { notImplemented(); return Vector<String>(); }
-bool PluginDatabase::isPreferredPluginPath(const String&) { notImplemented(); return false; }
-int PluginPackage::compare(const PluginPackage&) const { notImplemented(); return 0; }
-bool PluginPackage::fetchInfo() { notImplemented(); return false; }
-unsigned PluginPackage::hash() const { notImplemented(); return 0; }
-bool PluginPackage::equal(const PluginPackage&, const PluginPackage&) { notImplemented(); return false; }
-bool PluginPackage::load() { notImplemented(); return false; }
+PluginInfo* PluginInfoStore::createPluginInfoForPluginAtIndex(unsigned) { notImplemented(); return 0;}
+unsigned PluginInfoStore::pluginCount() const { notImplemented(); return 0; }
+String PluginInfoStore::pluginNameForMIMEType(const String& mimeType) { notImplemented(); return String(); }
+bool WebCore::PluginInfoStore::supportsMIMEType(const WebCore::String&) { notImplemented(); return false; }
+void WebCore::refreshPlugins(bool) { notImplemented(); }
+
Color WebCore::focusRingColor() { return 0xFF0000FF; }
void WebCore::setFocusRingColorChangeFunction(void (*)()) { }
diff --git a/WebCore/platform/gtk/ThreadingGtk.cpp b/WebCore/platform/gtk/ThreadingGtk.cpp
new file mode 100644
index 0000000..5ce6ba2
--- /dev/null
+++ b/WebCore/platform/gtk/ThreadingGtk.cpp
@@ -0,0 +1,209 @@
+/*
+ * Copyright (C) 2007, 2008 Apple Inc. All rights reserved.
+ * Copyright (C) 2007 Justin Haygood (jhaygood@reaktix.com)
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Apple Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "Threading.h"
+
+#include "HashMap.h"
+#include "Logging.h"
+
+#include <glib.h>
+
+namespace WebCore {
+
+struct FunctionWithContext {
+ MainThreadFunction* function;
+ void* context;
+};
+
+static gboolean callFunctionOnMainThread(gpointer data)
+{
+ FunctionWithContext* functionWithContext = static_cast<FunctionWithContext*>(data);
+ functionWithContext->function(functionWithContext->context);
+ delete functionWithContext;
+ return FALSE;
+}
+
+void callOnMainThread(MainThreadFunction* function, void* context)
+{
+ ASSERT(function);
+ FunctionWithContext* functionWithContext = new FunctionWithContext;
+ functionWithContext->function = function;
+ functionWithContext->context = context;
+ g_timeout_add(0, callFunctionOnMainThread, functionWithContext);
+}
+
+void initializeThreading()
+{
+ if (!g_thread_supported())
+ g_thread_init(NULL);
+ ASSERT(g_thread_supported());
+}
+
+static Mutex& threadMapMutex()
+{
+ static Mutex mutex;
+ return mutex;
+}
+
+static HashMap<ThreadIdentifier, GThread*>& threadMap()
+{
+ static HashMap<ThreadIdentifier, GThread*> map;
+ return map;
+}
+
+static ThreadIdentifier establishIdentifierForThread(GThread*& thread)
+{
+ MutexLocker locker(threadMapMutex());
+
+ static ThreadIdentifier identifierCount = 1;
+
+ threadMap().add(identifierCount, thread);
+
+ return identifierCount++;
+}
+
+static ThreadIdentifier identifierByGthreadHandle(GThread*& thread)
+{
+ MutexLocker locker(threadMapMutex());
+
+ HashMap<ThreadIdentifier, GThread*>::iterator i = threadMap().begin();
+ for (; i != threadMap().end(); ++i) {
+ if (i->second == thread)
+ return i->first;
+ }
+
+ return 0;
+}
+
+static GThread* threadForIdentifier(ThreadIdentifier id)
+{
+ MutexLocker locker(threadMapMutex());
+
+ return threadMap().get(id);
+}
+
+static void clearThreadForIdentifier(ThreadIdentifier id)
+{
+ MutexLocker locker(threadMapMutex());
+
+ ASSERT(threadMap().contains(id));
+
+ threadMap().remove(id);
+}
+
+ThreadIdentifier createThread(ThreadFunction entryPoint, void* data)
+{
+ GThread* thread;
+ if (!(thread = g_thread_create(entryPoint, data, TRUE, 0))) {
+ LOG_ERROR("Failed to create thread at entry point %p with data %p", entryPoint, data);
+ return 0;
+ }
+
+ ThreadIdentifier threadID = establishIdentifierForThread(thread);
+ LOG(Threading, "Created thread with thread id %u", threadID);
+ return threadID;
+}
+
+int waitForThreadCompletion(ThreadIdentifier threadID, void** result)
+{
+ ASSERT(threadID);
+
+ GThread* thread = threadForIdentifier(threadID);
+
+ *result = g_thread_join(thread);
+
+ clearThreadForIdentifier(threadID);
+ return 0;
+}
+
+void detachThread(ThreadIdentifier)
+{
+}
+
+ThreadIdentifier currentThread()
+{
+ GThread* currentThread = g_thread_self();
+ if (ThreadIdentifier id = identifierByGthreadHandle(currentThread))
+ return id;
+ return establishIdentifierForThread(currentThread);
+}
+
+Mutex::Mutex()
+ : m_mutex(g_mutex_new())
+{
+}
+
+Mutex::~Mutex()
+{
+ g_mutex_free(m_mutex);
+}
+
+void Mutex::lock()
+{
+ g_mutex_lock(m_mutex);
+}
+
+bool Mutex::tryLock()
+{
+ return g_mutex_trylock(m_mutex);
+}
+
+void Mutex::unlock()
+{
+ g_mutex_unlock(m_mutex);
+}
+
+ThreadCondition::ThreadCondition()
+ : m_condition(g_cond_new())
+{
+}
+
+ThreadCondition::~ThreadCondition()
+{
+ g_cond_free(m_condition);
+}
+
+void ThreadCondition::wait(Mutex& mutex)
+{
+ g_cond_wait(m_condition, mutex.impl());
+}
+
+void ThreadCondition::signal()
+{
+ g_cond_signal(m_condition);
+}
+
+void ThreadCondition::broadcast()
+{
+ g_cond_broadcast(m_condition);
+}
+
+
+}
diff --git a/WebCore/platform/gtk/WheelEventGtk.cpp b/WebCore/platform/gtk/WheelEventGtk.cpp
index 08f02cc..3368f25 100644
--- a/WebCore/platform/gtk/WheelEventGtk.cpp
+++ b/WebCore/platform/gtk/WheelEventGtk.cpp
@@ -29,11 +29,9 @@
#include "PlatformWheelEvent.h"
#include <gdk/gdk.h>
-#include <gtk/gtkversion.h>
namespace WebCore {
-// Keep this in sync with the other platform event constructors
PlatformWheelEvent::PlatformWheelEvent(GdkEventScroll* event)
{
static const float delta = 1;
@@ -63,12 +61,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
+ m_metaKey = event->state & GDK_MOD2_MASK;
m_isContinuous = false;
}