Changeset 185416 in webkit
- Timestamp:
- Jun 10, 2015 8:17:53 AM (9 years ago)
- Location:
- trunk/Source
- Files:
-
- 5 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r185415 r185416 1 2015-06-10 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [GTK] Move KeyBindingTranslator from platform to WebKit2 layer 4 https://bugs.webkit.org/show_bug.cgi?id=145840 5 6 Reviewed by Martin Robinson. 7 8 It's currently used only by WebKit2 in the UI process and it's 9 another file built twice because of the GTK2 plugin process. 10 11 * PlatformGTK.cmake: 12 1 13 2015-06-10 Carlos Garcia Campos <cgarcia@igalia.com> 2 14 -
trunk/Source/WebCore/PlatformGTK.cmake
r185358 r185416 221 221 platform/gtk/GtkUtilities.cpp 222 222 platform/gtk/GtkVersioning.c 223 platform/gtk/KeyBindingTranslator.cpp224 223 platform/gtk/LocalizedStringsGtk.cpp 225 224 platform/gtk/PasteboardGtk.cpp -
trunk/Source/WebKit2/ChangeLog
r185415 r185416 1 2015-06-10 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 [GTK] Move KeyBindingTranslator from platform to WebKit2 layer 4 https://bugs.webkit.org/show_bug.cgi?id=145840 5 6 Reviewed by Martin Robinson. 7 8 It's currently used only by WebKit2 in the UI process and it's 9 another file built twice because of the GTK2 plugin process. 10 11 * PlatformGTK.cmake: 12 * UIProcess/API/gtk/WebKitWebViewBase.cpp: 13 * UIProcess/gtk/KeyBindingTranslator.cpp: Renamed from Source/WebCore/platform/gtk/KeyBindingTranslator.cpp. 14 (WebKit::backspaceCallback): 15 (WebKit::selectAllCallback): 16 (WebKit::cutClipboardCallback): 17 (WebKit::copyClipboardCallback): 18 (WebKit::pasteClipboardCallback): 19 (WebKit::toggleOverwriteCallback): 20 (WebKit::popupMenuCallback): 21 (WebKit::showHelpCallback): 22 (WebKit::deleteFromCursorCallback): 23 (WebKit::moveCursorCallback): 24 (WebKit::KeyBindingTranslator::KeyBindingTranslator): 25 (WebKit::KeyBindingTranslator::commandsForKeyEvent): 26 * UIProcess/gtk/KeyBindingTranslator.h: Renamed from Source/WebCore/platform/gtk/KeyBindingTranslator.h. 27 (WebKit::KeyBindingTranslator::addPendingEditorCommand): 28 1 29 2015-06-10 Carlos Garcia Campos <cgarcia@igalia.com> 2 30 -
trunk/Source/WebKit2/PlatformGTK.cmake
r185410 r185416 283 283 UIProcess/gtk/GestureController.cpp 284 284 UIProcess/gtk/InputMethodFilter.cpp 285 UIProcess/gtk/KeyBindingTranslator.cpp 285 286 UIProcess/gtk/RedirectedXCompositeWindow.cpp 286 287 UIProcess/gtk/TextCheckerGtk.cpp -
trunk/Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBase.cpp
r185415 r185416 32 32 #include "DrawingAreaProxyImpl.h" 33 33 #include "InputMethodFilter.h" 34 #include "KeyBindingTranslator.h" 34 35 #include "NativeWebKeyboardEvent.h" 35 36 #include "NativeWebMouseEvent.h" … … 54 55 #include <WebCore/GtkUtilities.h> 55 56 #include <WebCore/GtkVersioning.h> 56 #include <WebCore/KeyBindingTranslator.h>57 57 #include <WebCore/NotImplemented.h> 58 58 #include <WebCore/PasteboardHelper.h> -
trunk/Source/WebKit2/UIProcess/gtk/KeyBindingTranslator.cpp
r185415 r185416 20 20 #include "KeyBindingTranslator.h" 21 21 22 #include "GtkVersioning.h"23 22 #include <gdk/gdkkeysyms.h> 24 #include <wtf/HashMap.h> 25 26 namespace WebCore { 27 28 typedef HashMap<int, const char*> IntConstCharHashMap; 23 #include <gtk/gtk.h> 24 25 namespace WebKit { 29 26 30 27 static void backspaceCallback(GtkWidget* widget, KeyBindingTranslator* translator) … … 117 114 const char* rawCommand = gtkDeleteCommands[deleteType][direction]; 118 115 if (!rawCommand) 119 return;116 return; 120 117 121 118 for (int i = 0; i < abs(count); i++) … … 186 183 187 184 static const KeyCombinationEntry customKeyBindings[] = { 188 { GDK_ b, GDK_CONTROL_MASK, "ToggleBold" },189 { GDK_ i, GDK_CONTROL_MASK, "ToggleItalic" },190 { GDK_ Escape, 0, "Cancel" },191 { GDK_ greater, GDK_CONTROL_MASK, "Cancel" },192 { GDK_ Tab, 0, "InsertTab" },193 { GDK_ Tab, GDK_SHIFT_MASK, "InsertBacktab" },185 { GDK_KEY_b, GDK_CONTROL_MASK, "ToggleBold" }, 186 { GDK_KEY_i, GDK_CONTROL_MASK, "ToggleItalic" }, 187 { GDK_KEY_Escape, 0, "Cancel" }, 188 { GDK_KEY_greater, GDK_CONTROL_MASK, "Cancel" }, 189 { GDK_KEY_Tab, 0, "InsertTab" }, 190 { GDK_KEY_Tab, GDK_SHIFT_MASK, "InsertBacktab" }, 194 191 }; 195 192 … … 198 195 ASSERT(m_pendingEditorCommands.isEmpty()); 199 196 200 // FIXME: Move KeyBindingTranslator to WebKit layer and remove the GTK2 code.201 #ifdef GTK_API_VERSION_2202 gtk_bindings_activate_event(GTK_OBJECT(m_nativeWidget.get()), event);203 #else204 197 gtk_bindings_activate_event(G_OBJECT(m_nativeWidget.get()), event); 205 #endif206 207 198 if (!m_pendingEditorCommands.isEmpty()) 208 199 return WTF::move(m_pendingEditorCommands); 209 200 210 201 // Special-case enter keys for we want them to work regardless of modifier. 211 if ((event->keyval == GDK_ Return || event->keyval == GDK_KP_Enter || event->keyval == GDK_ISO_Enter))202 if ((event->keyval == GDK_KEY_Return || event->keyval == GDK_KEY_KP_Enter || event->keyval == GDK_KEY_ISO_Enter)) 212 203 return { "InsertNewLine" }; 213 204 … … 225 216 } 226 217 227 } // namespace Web Core218 } // namespace WebKit -
trunk/Source/WebKit2/UIProcess/gtk/KeyBindingTranslator.h
r185415 r185416 20 20 #define KeyBindingTranslator_h 21 21 22 #include "GRefPtrGtk.h"22 #include <WebCore/GRefPtrGtk.h> 23 23 #include <wtf/Vector.h> 24 24 #include <wtf/text/WTFString.h> … … 26 26 typedef struct _GdkEventKey GdkEventKey; 27 27 28 namespace Web Core{28 namespace WebKit { 29 29 30 30 class KeyBindingTranslator { … … 40 40 }; 41 41 42 } // namespace Web Core42 } // namespace WebKit 43 43 44 44 #endif
Note: See TracChangeset
for help on using the changeset viewer.