Implement nacl_irt_memory for non-sfi mode.
[chromium-blink-merge.git] / ui / base / gtk / event_synthesis_gtk.h
blob0994f9fe7270ba96d3318efb7a11a0467f90d499
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
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.
9 #ifndef UI_BASE_GTK_EVENT_SYNTHESIS_GTK_
10 #define UI_BASE_GTK_EVENT_SYNTHESIS_GTK_
12 #include <gdk/gdk.h>
13 #include <gdk/gdkkeysyms.h>
14 #include <vector>
16 #include "ui/base/ui_base_export.h"
17 #include "ui/events/keycodes/keyboard_codes.h"
19 namespace ui {
21 // Creates and returns a key event. Passes ownership to the caller.
22 UI_BASE_EXPORT GdkEvent* SynthesizeKeyEvent(GdkWindow* event_window,
23 bool press,
24 guint gdk_key,
25 guint state);
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 UI_BASE_EXPORT void SynthesizeKeyPressEvents(GdkWindow* window,
30 KeyboardCode key,
31 bool control,
32 bool shift,
33 bool alt,
34 std::vector<GdkEvent*>* events);
36 } // namespace ui
38 #endif // UI_BASE_GTK_EVENT_SYNTHESIS_GTK_