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 /** */
33 public struct Testing
34 {
35 
36 	/**
37 	 * Retrieves a pixel from @window to force the windowing
38 	 * system to carry out any pending rendering commands.
39 	 *
40 	 * This function is intended to be used to synchronize with rendering
41 	 * pipelines, to benchmark windowing system rendering operations.
42 	 *
43 	 * Params:
44 	 *     window = a mapped #GdkWindow
45 	 *
46 	 * Since: 2.14
47 	 */
48 	public static void testRenderSync(Window window)
49 	{
50 		gdk_test_render_sync((window is null) ? null : window.getWindowStruct());
51 	}
52 
53 	/**
54 	 * This function is intended to be used in GTK+ test programs.
55 	 * It will warp the mouse pointer to the given (@x,@y) coordinates
56 	 * within @window and simulate a button press or release event.
57 	 * Because the mouse pointer needs to be warped to the target
58 	 * location, use of this function outside of test programs that
59 	 * run in their own virtual windowing system (e.g. Xvfb) is not
60 	 * recommended.
61 	 *
62 	 * Also, gdk_test_simulate_button() is a fairly low level function,
63 	 * for most testing purposes, gtk_test_widget_click() is the right
64 	 * function to call which will generate a button press event followed
65 	 * by its accompanying button release event.
66 	 *
67 	 * Params:
68 	 *     window = a #GdkWindow to simulate a button event for
69 	 *     x = x coordinate within @window for the button event
70 	 *     y = y coordinate within @window for the button event
71 	 *     button = Number of the pointer button for the event, usually 1, 2 or 3
72 	 *     modifiers = Keyboard modifiers the event is setup with
73 	 *     buttonPressrelease = either %GDK_BUTTON_PRESS or %GDK_BUTTON_RELEASE
74 	 *
75 	 * Return: whether all actions necessary for a button event simulation
76 	 *     were carried out successfully
77 	 *
78 	 * Since: 2.14
79 	 */
80 	public static bool testSimulateButton(Window window, int x, int y, uint button, GdkModifierType modifiers, GdkEventType buttonPressrelease)
81 	{
82 		return gdk_test_simulate_button((window is null) ? null : window.getWindowStruct(), x, y, button, modifiers, buttonPressrelease) != 0;
83 	}
84 
85 	/**
86 	 * This function is intended to be used in GTK+ test programs.
87 	 * If (@x,@y) are > (-1,-1), it will warp the mouse pointer to
88 	 * the given (@x,@y) coordinates within @window and simulate a
89 	 * key press or release event.
90 	 *
91 	 * When the mouse pointer is warped to the target location, use
92 	 * of this function outside of test programs that run in their
93 	 * own virtual windowing system (e.g. Xvfb) is not recommended.
94 	 * If (@x,@y) are passed as (-1,-1), the mouse pointer will not
95 	 * be warped and @window origin will be used as mouse pointer
96 	 * location for the event.
97 	 *
98 	 * Also, gdk_test_simulate_key() is a fairly low level function,
99 	 * for most testing purposes, gtk_test_widget_send_key() is the
100 	 * right function to call which will generate a key press event
101 	 * followed by its accompanying key release event.
102 	 *
103 	 * Params:
104 	 *     window = a #GdkWindow to simulate a key event for
105 	 *     x = x coordinate within @window for the key event
106 	 *     y = y coordinate within @window for the key event
107 	 *     keyval = A GDK keyboard value
108 	 *     modifiers = Keyboard modifiers the event is setup with
109 	 *     keyPressrelease = either %GDK_KEY_PRESS or %GDK_KEY_RELEASE
110 	 *
111 	 * Return: whether all actions necessary for a key event simulation
112 	 *     were carried out successfully
113 	 *
114 	 * Since: 2.14
115 	 */
116 	public static bool testSimulateKey(Window window, int x, int y, uint keyval, GdkModifierType modifiers, GdkEventType keyPressrelease)
117 	{
118 		return gdk_test_simulate_key((window is null) ? null : window.getWindowStruct(), x, y, keyval, modifiers, keyPressrelease) != 0;
119 	}
120 }