| 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 APP_EVENT_SYNTHESIS_GTK_ | |
| 10 #define APP_EVENT_SYNTHESIS_GTK_ | |
| 11 #pragma once | |
| 12 | |
| 13 #include <gdk/gdk.h> | |
| 14 #include <gdk/gdkkeysyms.h> | |
| 15 #include <vector> | |
| 16 | |
| 17 #include "app/keyboard_codes.h" | |
| 18 | |
| 19 namespace app { | |
| 20 | |
| 21 // Creates and returns a key event. Passes ownership to the caller. | |
| 22 GdkEvent* SynthesizeKeyEvent(GdkWindow* event_window, | |
| 23 bool press, | |
| 24 guint gdk_key, | |
| 25 guint state); | |
| 26 | |
| 27 // Creates the proper sequence of key events for a key press + release. | |
| 28 // Ownership of the events in the vector is passed to the caller. | |
| 29 void SynthesizeKeyPressEvents( | |
| 30 GdkWindow* window, | |
| 31 app::KeyboardCode key, | |
| 32 bool control, bool shift, bool alt, | |
| 33 std::vector<GdkEvent*>* events); | |
| 34 | |
| 35 } // namespace app | |
| 36 | |
| 37 #endif // APP_EVENT_SYNTHESIS_GTK_ | |
| OLD | NEW |