1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19 
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 
25 module gdk.Testing;
26 
27 private import gdk.Window;
28 private import gtkc.gdk;
29 public  import gtkc.gdktypes;
30 
31 
32 public struct Testing
33 {
34 	/**
35 	 */
36 
37 	/**
38 	 * Retrieves a pixel from @window to force the windowing
39 	 * system to carry out any pending rendering commands.
40 	 *
41 	 * This function is intended to be used to synchronize with rendering
42 	 * pipelines, to benchmark windowing system rendering operations.
43 	 *
44 	 * Params:
45 	 *     window = a mapped #GdkWindow
46 	 *
47 	 * Since: 2.14
48 	 */
49 	public static void testRenderSync(Window window)
50 	{
51 		gdk_test_render_sync((window is null) ? null : window.getWindowStruct());
52 	}
53 
54 	/**
55 	 * This function is intended to be used in GTK+ test programs.
56 	 * It will warp the mouse pointer to the given (@x,@y) coordinates
57 	 * within @window and simulate a button press or release event.
58 	 * Because the mouse pointer needs to be warped to the target
59 	 * location, use of this function outside of test programs that
60 	 * run in their own virtual windowing system (e.g. Xvfb) is not
61 	 * recommended.
62 	 *
63 	 * Also, gdk_test_simulate_button() is a fairly low level function,
64 	 * for most testing purposes, gtk_test_widget_click() is the right
65 	 * function to call which will generate a button press event followed
66 	 * by its accompanying button release event.
67 	 *
68 	 * Params:
69 	 *     window = a #GdkWindow to simulate a button event for
70 	 *     x = x coordinate within @window for the button event
71 	 *     y = y coordinate within @window for the button event
72 	 *     button = Number of the pointer button for the event, usually 1, 2 or 3
73 	 *     modifiers = Keyboard modifiers the event is setup with
74 	 *     buttonPressrelease = either %GDK_BUTTON_PRESS or %GDK_BUTTON_RELEASE
75 	 *
76 	 * Return: whether all actions necessary for a button event simulation
77 	 *     were carried out successfully
78 	 *
79 	 * Since: 2.14
80 	 */
81 	public static bool testSimulateButton(Window window, int x, int y, uint button, GdkModifierType modifiers, GdkEventType buttonPressrelease)
82 	{
83 		return gdk_test_simulate_button((window is null) ? null : window.getWindowStruct(), x, y, button, modifiers, buttonPressrelease) != 0;
84 	}
85 
86 	/**
87 	 * This function is intended to be used in GTK+ test programs.
88 	 * If (@x,@y) are > (-1,-1), it will warp the mouse pointer to
89 	 * the given (@x,@y) coordinates within @window and simulate a
90 	 * key press or release event.
91 	 *
92 	 * When the mouse pointer is warped to the target location, use
93 	 * of this function outside of test programs that run in their
94 	 * own virtual windowing system (e.g. Xvfb) is not recommended.
95 	 * If (@x,@y) are passed as (-1,-1), the mouse pointer will not
96 	 * be warped and @window origin will be used as mouse pointer
97 	 * location for the event.
98 	 *
99 	 * Also, gdk_test_simulate_key() is a fairly low level function,
100 	 * for most testing purposes, gtk_test_widget_send_key() is the
101 	 * right function to call which will generate a key press event
102 	 * followed by its accompanying key release event.
103 	 *
104 	 * Params:
105 	 *     window = a #GdkWindow to simulate a key event for
106 	 *     x = x coordinate within @window for the key event
107 	 *     y = y coordinate within @window for the key event
108 	 *     keyval = A GDK keyboard value
109 	 *     modifiers = Keyboard modifiers the event is setup with
110 	 *     keyPressrelease = either %GDK_KEY_PRESS or %GDK_KEY_RELEASE
111 	 *
112 	 * Return: whether all actions necessary for a key event simulation
113 	 *     were carried out successfully
114 	 *
115 	 * Since: 2.14
116 	 */
117 	public static bool testSimulateKey(Window window, int x, int y, uint keyval, GdkModifierType modifiers, GdkEventType keyPressrelease)
118 	{
119 		return gdk_test_simulate_key((window is null) ? null : window.getWindowStruct(), x, y, keyval, modifiers, keyPressrelease) != 0;
120 	}
121 }