File: gdk-Testing.html

package info (click to toggle)
gtk%2B2.0 2.20.1-2%2Bdeb6u2
  • links: PTS, VCS
  • area: main
  • in suites: squeeze-lts
  • size: 136,284 kB
  • ctags: 66,487
  • sloc: ansic: 590,318; sh: 10,559; makefile: 5,573; xml: 1,357; python: 866; perl: 776; asm: 457; awk: 72; cpp: 34
file content (223 lines) | stat: -rw-r--r-- 15,241 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Testing</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
<link rel="home" href="index.html" title="GDK Reference Manual">
<link rel="up" href="reference.html" title="API Reference">
<link rel="prev" href="gdk-Application-launching.html" title="Application launching">
<link rel="next" href="api-index-full.html" title="Index of all symbols">
<meta name="generator" content="GTK-Doc V1.14 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="gdk-Application-launching.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="reference.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GDK Reference Manual</th>
<td><a accesskey="n" href="api-index-full.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#gdk-Testing.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#gdk-Testing.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry" title="Testing">
<a name="gdk-Testing"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="gdk-Testing.top_of_page"></a>Testing</span></h2>
<p>Testing — Test utilities</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv" title="Synopsis">
<a name="gdk-Testing.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include &lt;gdk/gdk.h&gt;

<span class="returnvalue">void</span>                <a class="link" href="gdk-Testing.html#gdk-test-render-sync" title="gdk_test_render_sync ()">gdk_test_render_sync</a>                (<em class="parameter"><code><a class="link" href="gdk-Windows.html#GdkWindow"><span class="type">GdkWindow</span></a> *window</code></em>);
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="gdk-Testing.html#gdk-test-simulate-button" title="gdk_test_simulate_button ()">gdk_test_simulate_button</a>            (<em class="parameter"><code><a class="link" href="gdk-Windows.html#GdkWindow"><span class="type">GdkWindow</span></a> *window</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> x</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> y</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> button</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gdk-Windows.html#GdkModifierType" title="enum GdkModifierType"><span class="type">GdkModifierType</span></a> modifiers</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gdk-Events.html#GdkEventType" title="enum GdkEventType"><span class="type">GdkEventType</span></a> button_pressrelease</code></em>);
<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="gdk-Testing.html#gdk-test-simulate-key" title="gdk_test_simulate_key ()">gdk_test_simulate_key</a>               (<em class="parameter"><code><a class="link" href="gdk-Windows.html#GdkWindow"><span class="type">GdkWindow</span></a> *window</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> x</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> y</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> keyval</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gdk-Windows.html#GdkModifierType" title="enum GdkModifierType"><span class="type">GdkModifierType</span></a> modifiers</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gdk-Events.html#GdkEventType" title="enum GdkEventType"><span class="type">GdkEventType</span></a> key_pressrelease</code></em>);
</pre>
</div>
<div class="refsect1" title="Description">
<a name="gdk-Testing.description"></a><h2>Description</h2>
<p>
The functions in this section are intended to be used in test programs.
They allow to simulate some user input.
</p>
</div>
<div class="refsect1" title="Details">
<a name="gdk-Testing.details"></a><h2>Details</h2>
<div class="refsect2" title="gdk_test_render_sync ()">
<a name="gdk-test-render-sync"></a><h3>gdk_test_render_sync ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gdk_test_render_sync                (<em class="parameter"><code><a class="link" href="gdk-Windows.html#GdkWindow"><span class="type">GdkWindow</span></a> *window</code></em>);</pre>
<p>
This function retrives a pixel from <em class="parameter"><code>window</code></em> to force the windowing
system to carry out any pending rendering commands.
This function is intended to be used to syncronize with rendering
pipelines, to benchmark windowing system rendering operations.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>window</code></em> :</span></p></td>
<td>a mapped GdkWindow
</td>
</tr></tbody>
</table></div>
<p class="since">Since 2.14</p>
</div>
<hr>
<div class="refsect2" title="gdk_test_simulate_button ()">
<a name="gdk-test-simulate-button"></a><h3>gdk_test_simulate_button ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            gdk_test_simulate_button            (<em class="parameter"><code><a class="link" href="gdk-Windows.html#GdkWindow"><span class="type">GdkWindow</span></a> *window</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> x</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> y</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> button</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gdk-Windows.html#GdkModifierType" title="enum GdkModifierType"><span class="type">GdkModifierType</span></a> modifiers</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gdk-Events.html#GdkEventType" title="enum GdkEventType"><span class="type">GdkEventType</span></a> button_pressrelease</code></em>);</pre>
<p>
This function is intended to be used in Gtk+ test programs.
It will warp the mouse pointer to the given (<em class="parameter"><code>x</code></em>,<em class="parameter"><code>y</code></em>) corrdinates
within <em class="parameter"><code>window</code></em> and simulate a button press or release event.
Because the mouse pointer needs to be warped to the target
location, use of this function outside of test programs that
run in their own virtual windowing system (e.g. Xvfb) is not
recommended.
Also, <code class="function">gtk_test_simulate_button()</code> is a fairly low level function,
for most testing purposes, <a href="http://library.gnome.org/devel/gtk/unstable/gtk-Testing.html#gtk-test-widget-click"><code class="function">gtk_test_widget_click()</code></a> is the right
function to call which will generate a button press event followed
by its accompanying button release event.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>window</code></em> :</span></p></td>
<td>Gdk window to simulate a button event for.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
<td>x coordinate within <em class="parameter"><code>window</code></em> for the button event.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>y</code></em> :</span></p></td>
<td>y coordinate within <em class="parameter"><code>window</code></em> for the button event.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>button</code></em> :</span></p></td>
<td>Number of the pointer button for the event, usually 1, 2 or 3.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>modifiers</code></em> :</span></p></td>
<td>Keyboard modifiers the event is setup with.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>button_pressrelease</code></em> :</span></p></td>
<td>either <a class="link" href="gdk-Events.html#GDK-BUTTON-PRESS:CAPS"><code class="literal">GDK_BUTTON_PRESS</code></a> or <a class="link" href="gdk-Events.html#GDK-BUTTON-RELEASE:CAPS"><code class="literal">GDK_BUTTON_RELEASE</code></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> wether all actions neccessary for a button event simulation were carried out successfully.
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.14</p>
</div>
<hr>
<div class="refsect2" title="gdk_test_simulate_key ()">
<a name="gdk-test-simulate-key"></a><h3>gdk_test_simulate_key ()</h3>
<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            gdk_test_simulate_key               (<em class="parameter"><code><a class="link" href="gdk-Windows.html#GdkWindow"><span class="type">GdkWindow</span></a> *window</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> x</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gint"><span class="type">gint</span></a> y</code></em>,
                                                         <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> keyval</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gdk-Windows.html#GdkModifierType" title="enum GdkModifierType"><span class="type">GdkModifierType</span></a> modifiers</code></em>,
                                                         <em class="parameter"><code><a class="link" href="gdk-Events.html#GdkEventType" title="enum GdkEventType"><span class="type">GdkEventType</span></a> key_pressrelease</code></em>);</pre>
<p>
This function is intended to be used in Gtk+ test programs.
If (<em class="parameter"><code>x</code></em>,<em class="parameter"><code>y</code></em>) are &gt; (-1,-1), it will warp the mouse pointer to
the given (<em class="parameter"><code>x</code></em>,<em class="parameter"><code>y</code></em>) corrdinates within <em class="parameter"><code>window</code></em> and simulate a
key press or release event.
When the mouse pointer is warped to the target location, use
of this function outside of test programs that run in their
own virtual windowing system (e.g. Xvfb) is not recommended.
If (<em class="parameter"><code>x</code></em>,<em class="parameter"><code>y</code></em>) are passed as (-1,-1), the mouse pointer will not
be warped and <em class="parameter"><code>window</code></em> origin will be used as mouse pointer
location for the event.
Also, <code class="function">gtk_test_simulate_key()</code> is a fairly low level function,
for most testing purposes, <a href="http://library.gnome.org/devel/gtk/unstable/gtk-Testing.html#gtk-test-widget-send-key"><code class="function">gtk_test_widget_send_key()</code></a> is the
right function to call which will generate a key press event
followed by its accompanying key release event.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>window</code></em> :</span></p></td>
<td>Gdk window to simulate a key event for.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>x</code></em> :</span></p></td>
<td>x coordinate within <em class="parameter"><code>window</code></em> for the key event.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>y</code></em> :</span></p></td>
<td>y coordinate within <em class="parameter"><code>window</code></em> for the key event.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>keyval</code></em> :</span></p></td>
<td>A Gdk keyboard value.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>modifiers</code></em> :</span></p></td>
<td>Keyboard modifiers the event is setup with.
</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>key_pressrelease</code></em> :</span></p></td>
<td>either <a class="link" href="gdk-Events.html#GDK-KEY-PRESS:CAPS"><code class="literal">GDK_KEY_PRESS</code></a> or <a class="link" href="gdk-Events.html#GDK-KEY-RELEASE:CAPS"><code class="literal">GDK_KEY_RELEASE</code></a>
</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td> wether all actions neccessary for a key event simulation were carried out successfully.
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.14</p>
</div>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.14</div>
</body>
</html>