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  = gdk-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 
63 private import gdk.Window;
64 
65 
66 
67 
68 /**
69  * Description
70  * The functions in this section are intended to be used in test programs.
71  * They allow to simulate some user input.
72  */
73 public class Testing
74 {
75 	
76 	/**
77 	 */
78 	
79 	/**
80 	 * This function retrives a pixel from window to force the windowing
81 	 * system to carry out any pending rendering commands.
82 	 * This function is intended to be used to syncronize with rendering
83 	 * pipelines, to benchmark windowing system rendering operations.
84 	 * Since 2.14
85 	 * Params:
86 	 * window = a mapped GdkWindow
87 	 */
88 	public static void renderSync(Window window)
89 	{
90 		// void gdk_test_render_sync (GdkWindow *window);
91 		gdk_test_render_sync((window is null) ? null : window.getWindowStruct());
92 	}
93 	
94 	/**
95 	 * This function is intended to be used in Gtk+ test programs.
96 	 * It will warp the mouse pointer to the given (x,y) corrdinates
97 	 * within window and simulate a button press or release event.
98 	 * Because the mouse pointer needs to be warped to the target
99 	 * location, use of this function outside of test programs that
100 	 * run in their own virtual windowing system (e.g. Xvfb) is not
101 	 * recommended.
102 	 * Also, gtk_test_simulate_button() is a fairly low level function,
103 	 * for most testing purposes, gtk_test_widget_click() is the right
104 	 * function to call which will generate a button press event followed
105 	 * by its accompanying button release event.
106 	 * Since 2.14
107 	 * Params:
108 	 * window = Gdk window to simulate a button event for.
109 	 * x = x coordinate within window for the button event.
110 	 * y = y coordinate within window for the button event.
111 	 * button = Number of the pointer button for the event, usually 1, 2 or 3.
112 	 * modifiers = Keyboard modifiers the event is setup with.
113 	 * buttonPressrelease = either GDK_BUTTON_PRESS or GDK_BUTTON_RELEASE
114 	 * Returns: wether all actions neccessary for a button event simulation were carried out successfully.
115 	 */
116 	public static int simulateButton(Window window, int x, int y, uint button, GdkModifierType modifiers, GdkEventType buttonPressrelease)
117 	{
118 		// gboolean gdk_test_simulate_button (GdkWindow *window,  gint x,  gint y,  guint button,  GdkModifierType modifiers,  GdkEventType button_pressrelease);
119 		return gdk_test_simulate_button((window is null) ? null : window.getWindowStruct(), x, y, button, modifiers, buttonPressrelease);
120 	}
121 	
122 	/**
123 	 * This function is intended to be used in Gtk+ test programs.
124 	 * If (x,y) are > (-1,-1), it will warp the mouse pointer to
125 	 * the given (x,y) corrdinates within window and simulate a
126 	 * key press or release event.
127 	 * When the mouse pointer is warped to the target location, use
128 	 * of this function outside of test programs that run in their
129 	 * own virtual windowing system (e.g. Xvfb) is not recommended.
130 	 * If (x,y) are passed as (-1,-1), the mouse pointer will not
131 	 * be warped and window origin will be used as mouse pointer
132 	 * location for the event.
133 	 * Also, gtk_test_simulate_key() is a fairly low level function,
134 	 * for most testing purposes, gtk_test_widget_send_key() is the
135 	 * right function to call which will generate a key press event
136 	 * followed by its accompanying key release event.
137 	 * Since 2.14
138 	 * Params:
139 	 * window = Gdk window to simulate a key event for.
140 	 * x = x coordinate within window for the key event.
141 	 * y = y coordinate within window for the key event.
142 	 * keyval = A Gdk keyboard value.
143 	 * modifiers = Keyboard modifiers the event is setup with.
144 	 * keyPressrelease = either GDK_KEY_PRESS or GDK_KEY_RELEASE
145 	 * Returns: wether all actions neccessary for a key event simulation were carried out successfully.
146 	 */
147 	public static int simulateKey(Window window, int x, int y, uint keyval, GdkModifierType modifiers, GdkEventType keyPressrelease)
148 	{
149 		// gboolean gdk_test_simulate_key (GdkWindow *window,  gint x,  gint y,  guint keyval,  GdkModifierType modifiers,  GdkEventType key_pressrelease);
150 		return gdk_test_simulate_key((window is null) ? null : window.getWindowStruct(), x, y, keyval, modifiers, keyPressrelease);
151 	}
152 }