| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 // | 4 // |
| 5 // This file declares routines for creating fake GDK events (at the moment, | 5 // This file declares routines for creating fake GDK events (at the moment, |
| 6 // only keyboard events). This is useful for a variety of testing purposes. | 6 // only keyboard events). This is useful for a variety of testing purposes. |
| 7 // NOTE: This should not be used outside of testing. | 7 // NOTE: This should not be used outside of testing. |
| 8 | 8 |
| 9 #ifndef UI_BASE_GTK_EVENT_SYNTHESIS_GTK_ | 9 #ifndef UI_BASE_GTK_EVENT_SYNTHESIS_GTK_ |
| 10 #define UI_BASE_GTK_EVENT_SYNTHESIS_GTK_ | 10 #define UI_BASE_GTK_EVENT_SYNTHESIS_GTK_ |
| 11 #pragma once | 11 #pragma once |
| 12 | 12 |
| 13 #include <gdk/gdk.h> | 13 #include <gdk/gdk.h> |
| 14 #include <gdk/gdkkeysyms.h> | 14 #include <gdk/gdkkeysyms.h> |
| 15 #include <vector> | 15 #include <vector> |
| 16 | 16 |
| 17 #include "ui/base/keycodes/keyboard_codes.h" | 17 #include "ui/base/keycodes/keyboard_codes.h" |
| 18 #include "ui/ui_api.h" | 18 #include "ui/base/ui_export.h" |
| 19 | 19 |
| 20 namespace ui { | 20 namespace ui { |
| 21 | 21 |
| 22 // Creates and returns a key event. Passes ownership to the caller. | 22 // Creates and returns a key event. Passes ownership to the caller. |
| 23 UI_API GdkEvent* SynthesizeKeyEvent(GdkWindow* event_window, | 23 UI_EXPORT GdkEvent* SynthesizeKeyEvent(GdkWindow* event_window, |
| 24 bool press, | 24 bool press, |
| 25 guint gdk_key, | 25 guint gdk_key, |
| 26 guint state); | 26 guint state); |
| 27 | 27 |
| 28 // Creates the proper sequence of key events for a key press + release. | 28 // Creates the proper sequence of key events for a key press + release. |
| 29 // Ownership of the events in the vector is passed to the caller. | 29 // Ownership of the events in the vector is passed to the caller. |
| 30 UI_API void SynthesizeKeyPressEvents( | 30 UI_EXPORT void SynthesizeKeyPressEvents( |
| 31 GdkWindow* window, | 31 GdkWindow* window, |
| 32 KeyboardCode key, | 32 KeyboardCode key, |
| 33 bool control, bool shift, bool alt, | 33 bool control, bool shift, bool alt, |
| 34 std::vector<GdkEvent*>* events); | 34 std::vector<GdkEvent*>* events); |
| 35 | 35 |
| 36 } // namespace ui | 36 } // namespace ui |
| 37 | 37 |
| 38 #endif // UI_BASE_GTK_EVENT_SYNTHESIS_GTK_ | 38 #endif // UI_BASE_GTK_EVENT_SYNTHESIS_GTK_ |
| OLD | NEW |