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  * Conversion parameters:
26  * inFile  = gdk3-Testing.html
27  * outPack = gdk
28  * outFile = Testing
29  * strct   = 
30  * realStrct=
31  * ctorStrct=
32  * clss    = Testing
33  * interf  = 
34  * class Code: No
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * prefixes:
40  * 	- gdk_test_
41  * omit structs:
42  * omit prefixes:
43  * omit code:
44  * omit signals:
45  * imports:
46  * 	- gdk.Window
47  * structWrap:
48  * 	- GdkWindow* -> Window
49  * module aliases:
50  * local aliases:
51  * overrides:
52  */
53 
54 module gdk.Testing;
55 
56 public  import gtkc.gdktypes;
57 
58 private import gtkc.gdk;
59 private import glib.ConstructionException;
60 private import gobject.ObjectG;
61 
62 private import gdk.Window;
63 
64 
65 
66 /**
67  * The functions in this section are intended to be used in test programs.
68  * They allow to simulate some user input.
69  */
70 public class Testing
71 {
72 	
73 	/**
74 	 */
75 	
76 	/**
77 	 * Retrieves a pixel from window to force the windowing
78 	 * system to carry out any pending rendering commands.
79 	 * This function is intended to be used to synchronize with rendering
80 	 * pipelines, to benchmark windowing system rendering operations.
81 	 * Since 2.14
82 	 * Params:
83 	 * window = a mapped GdkWindow
84 	 */
85 	public static void renderSync(Window window)
86 	{
87 		// void gdk_test_render_sync (GdkWindow *window);
88 		gdk_test_render_sync((window is null) ? null : window.getWindowStruct());
89 	}
90 	
91 	/**
92 	 * This function is intended to be used in GTK+ test programs.
93 	 * It will warp the mouse pointer to the given (x,y) coordinates
94 	 * within window and simulate a button press or release event.
95 	 * Because the mouse pointer needs to be warped to the target
96 	 * location, use of this function outside of test programs that
97 	 * run in their own virtual windowing system (e.g. Xvfb) is not
98 	 * recommended.
99 	 * Also, gdk_test_simulate_button() is a fairly low level function,
100 	 * for most testing purposes, gtk_test_widget_click() is the right
101 	 * function to call which will generate a button press event followed
102 	 * by its accompanying button release event.
103 	 * Since 2.14
104 	 * Params:
105 	 * window = a GdkWindow to simulate a button event for
106 	 * x = x coordinate within window for the button event
107 	 * y = y coordinate within window for the button event
108 	 * button = Number of the pointer button for the event, usually 1, 2 or 3
109 	 * modifiers = Keyboard modifiers the event is setup with
110 	 * buttonPressrelease = either GDK_BUTTON_PRESS or GDK_BUTTON_RELEASE
111 	 * Returns: whether all actions necessary for a button event simulation were carried out successfully
112 	 */
113 	public static int simulateButton(Window window, int x, int y, uint button, GdkModifierType modifiers, GdkEventType buttonPressrelease)
114 	{
115 		// gboolean gdk_test_simulate_button (GdkWindow *window,  gint x,  gint y,  guint button,  GdkModifierType modifiers,  GdkEventType button_pressrelease);
116 		return gdk_test_simulate_button((window is null) ? null : window.getWindowStruct(), x, y, button, modifiers, buttonPressrelease);
117 	}
118 	
119 	/**
120 	 * This function is intended to be used in GTK+ test programs.
121 	 * If (x,y) are > (-1,-1), it will warp the mouse pointer to
122 	 * the given (x,y) coordinates within window and simulate a
123 	 * key press or release event.
124 	 * When the mouse pointer is warped to the target location, use
125 	 * of this function outside of test programs that run in their
126 	 * own virtual windowing system (e.g. Xvfb) is not recommended.
127 	 * If (x,y) are passed as (-1,-1), the mouse pointer will not
128 	 * be warped and window origin will be used as mouse pointer
129 	 * location for the event.
130 	 * Also, gdk_test_simulate_key() is a fairly low level function,
131 	 * for most testing purposes, gtk_test_widget_send_key() is the
132 	 * right function to call which will generate a key press event
133 	 * followed by its accompanying key release event.
134 	 * Since 2.14
135 	 * Params:
136 	 * window = a GdkWindow to simulate a key event for
137 	 * x = x coordinate within window for the key event
138 	 * y = y coordinate within window for the key event
139 	 * keyval = A GDK keyboard value
140 	 * modifiers = Keyboard modifiers the event is setup with
141 	 * keyPressrelease = either GDK_KEY_PRESS or GDK_KEY_RELEASE
142 	 * Returns: whether all actions necessary for a key event simulation were carried out successfully
143 	 */
144 	public static int simulateKey(Window window, int x, int y, uint keyval, GdkModifierType modifiers, GdkEventType keyPressrelease)
145 	{
146 		// gboolean gdk_test_simulate_key (GdkWindow *window,  gint x,  gint y,  guint keyval,  GdkModifierType modifiers,  GdkEventType key_pressrelease);
147 		return gdk_test_simulate_key((window is null) ? null : window.getWindowStruct(), x, y, keyval, modifiers, keyPressrelease);
148 	}
149 }