OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 // | |
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. | |
7 // NOTE: This should not be used outside of testing. | |
8 | |
9 #ifndef CHROME_BASE_EVENT_SYNTHESIS_GTK_ | |
Hironori Bono
2010/05/19 03:25:14
nit: "CHROME_BASE_EVENT_SYNTHESIS_GTK_" -> "BASE_E
| |
10 #define CHROME_BASE_EVENT_SYNTHESIS_GTK_ | |
11 | |
12 #include <gdk/gdk.h> | |
13 #include <gdk/gdkkeysyms.h> | |
14 #include <vector> | |
15 | |
16 #include "base/keyboard_codes.h" | |
17 | |
18 namespace base { | |
19 | |
20 // Creates and returns a key event. Passes ownership to the caller. | |
21 GdkEvent* SynthesizeKeyEvent(GdkWindow* event_window, | |
22 bool press, | |
23 guint gdk_key, | |
24 guint state); | |
25 | |
26 // Creates the proper sequence of key events for a key press + release. | |
27 // Ownership of the events in the vector is passed to the caller. | |
28 void SynthesizeKeyPressEvents( | |
29 GdkWindow* window, | |
30 base::KeyboardCode key, | |
31 bool control, bool shift, bool alt, | |
32 std::vector<GdkEvent*>* events); | |
33 | |
34 } // namespace base | |
35 | |
36 #endif // CHROME_BASE_EVENT_SYNTHESIS_GTK_ | |
OLD | NEW |