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