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
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/kernel/qwindowsystem_qws.cpp:856 -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>QWSServer Class</title>
<style type="text/css"><!--
fn { margin-left: 1cm; text-indent: -1cm; }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
body { background: #ffffff; color: black; }
--></style>
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr bgcolor="#E5E5E5">
<td valign=center>
<a href="index.html">
<font color="#004faf">Home</font></a>
| <a href="classes.html">
<font color="#004faf">All Classes</font></a>
| <a href="mainclasses.html">
<font color="#004faf">Main Classes</font></a>
| <a href="annotated.html">
<font color="#004faf">Annotated</font></a>
| <a href="groups.html">
<font color="#004faf">Grouped Classes</font></a>
| <a href="functions.html">
<font color="#004faf">Functions</font></a>
</td>
<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QWSServer Class Reference</h1>
<p>The QWSServer class provides server-specific functionality in Qt/Embedded.
<a href="#details">More...</a>
<p><tt>#include <<a href="qwindowsystem_qws-h.html">qwindowsystem_qws.h</a>></tt>
<p><a href="qwsserver-members.html">List of all member functions.</a>
<h2>Public Members</h2>
<ul>
<li class=fn><a href="#QWSServer"><b>QWSServer</b></a> ( int flags = 0, QObject * parent = 0, const char * name = 0 )</li>
<li class=fn><a href="#~QWSServer"><b>~QWSServer</b></a> ()</li>
<li class=fn>enum <a href="#ServerFlags-enum"><b>ServerFlags</b></a> { DisableKeyboard = 0x01, DisableMouse = 0x02 }</li>
<li class=fn>enum <a href="#GUIMode-enum"><b>GUIMode</b></a> { NoGui = FALSE, NormalGUI = TRUE, Server }</li>
<li class=fn>void <a href="#sendIMEvent"><b>sendIMEvent</b></a> ( IMState state, const QString & txt, int cpos, int selLen )</li>
<li class=fn>class <b>KeyMap</b> { }</li>
<li class=fn>class <b>KeyOverride</b> { }</li>
<li class=fn>class <a href="#KeyboardFilter"><b>KeyboardFilter</b></a> { }</li>
<li class=fn>QWSWindow * <a href="#windowAt"><b>windowAt</b></a> ( const QPoint & pos )</li>
<li class=fn>const QPtrList<QWSWindow> & <a href="#clientWindows"><b>clientWindows</b></a> ()</li>
<li class=fn>void <a href="#openMouse"><b>openMouse</b></a> ()</li>
<li class=fn>void <a href="#closeMouse"><b>closeMouse</b></a> ()</li>
<li class=fn>void <a href="#openKeyboard"><b>openKeyboard</b></a> ()</li>
<li class=fn>void <a href="#closeKeyboard"><b>closeKeyboard</b></a> ()</li>
<li class=fn>void <a href="#refresh"><b>refresh</b></a> ()</li>
<li class=fn>void <a href="#refresh-2"><b>refresh</b></a> ( QRegion & r )</li>
<li class=fn>void <a href="#enablePainting"><b>enablePainting</b></a> ( bool e )</li>
<li class=fn>QWSPropertyManager * <a href="#manager"><b>manager</b></a> ()</li>
<li class=fn>enum <a href="#WindowEvent-enum"><b>WindowEvent</b></a> { Create = 0x0001, Destroy = 0x0002, Hide = 0x0004, Show = 0x0008, Raise = 0x0010, Lower = 0x0020, Geometry = 0x0040, Active = 0x0080, Name = 0x0100 }</li>
</ul>
<h2>Signals</h2>
<ul>
<li class=fn>void <a href="#windowEvent"><b>windowEvent</b></a> ( QWSWindow * w, QWSServer::WindowEvent e )</li>
<li class=fn>void <a href="#newChannel"><b>newChannel</b></a> ( const QString & channel )</li>
<li class=fn>void <a href="#removedChannel"><b>removedChannel</b></a> ( const QString & channel )</li>
</ul>
<h2>Static Public Members</h2>
<ul>
<li class=fn>void <a href="#sendKeyEvent"><b>sendKeyEvent</b></a> ( int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat )</li>
<li class=fn>const KeyMap * <a href="#keyMap"><b>keyMap</b></a> ()</li>
<li class=fn>void <b>setOverrideKeys</b> ( const KeyOverride * )</li>
<li class=fn>void <a href="#setKeyboardFilter"><b>setKeyboardFilter</b></a> ( KeyboardFilter * f )</li>
<li class=fn>void <a href="#setDefaultMouse"><b>setDefaultMouse</b></a> ( const char * m )</li>
<li class=fn>void <a href="#setDefaultKeyboard"><b>setDefaultKeyboard</b></a> ( const char * k )</li>
<li class=fn>void <a href="#setMaxWindowRect"><b>setMaxWindowRect</b></a> ( const QRect & r )</li>
<li class=fn>void <a href="#setDesktopBackground"><b>setDesktopBackground</b></a> ( const QImage & img )</li>
<li class=fn>void <a href="#setDesktopBackground-2"><b>setDesktopBackground</b></a> ( const QColor & c )</li>
<li class=fn>QWSMouseHandler * <a href="#mouseHandler"><b>mouseHandler</b></a> ()</li>
<li class=fn>QWSKeyboardHandler * <a href="#keyboardHandler"><b>keyboardHandler</b></a> ()</li>
<li class=fn>void <a href="#setKeyboardHandler"><b>setKeyboardHandler</b></a> ( QWSKeyboardHandler * kh )</li>
<li class=fn>void <a href="#setScreenSaverIntervals"><b>setScreenSaverIntervals</b></a> ( int * ms )</li>
<li class=fn>void <a href="#setScreenSaverInterval"><b>setScreenSaverInterval</b></a> ( int ms )</li>
<li class=fn>bool <a href="#screenSaverActive"><b>screenSaverActive</b></a> ()</li>
<li class=fn>void <a href="#screenSaverActivate"><b>screenSaverActivate</b></a> ( bool activate )</li>
<li class=fn>void <a href="#setCursorVisible"><b>setCursorVisible</b></a> ( bool vis )</li>
<li class=fn>bool <a href="#isCursorVisible"><b>isCursorVisible</b></a> ()</li>
</ul>
<hr><a name="details"></a><h2>Detailed Description</h2>
The QWSServer class provides server-specific functionality in Qt/Embedded.
<p>
<p> When you run a Qt/Embedded application, it either runs as a server
or connects to an existing server. If it runs as a server, some
additional operations are provided by this class.
<p> This class is instantiated by <a href="qapplication.html">QApplication</a> for Qt/Embedded server
processes. You should never construct this class yourself.
<p> A pointer to the QWSServer instance can be obtained via the global
<tt>qwsServer</tt> variable.
<p> The mouse and keyboard devices can be opened with <a href="#openMouse">openMouse</a>() and
<a href="#openKeyboard">openKeyboard</a>(). (Close them with <a href="#closeMouse">closeMouse</a>() and
<a href="#closeKeyboard">closeKeyboard</a>().)
<p> The display is refreshed with <a href="#refresh">refresh</a>(), and painting can be
enabled or disabled with <a href="#enablePainting">enablePainting</a>().
<p> Obtain the list of client windows with <a href="#clientWindows">clientWindows</a>() and find
out which window is at a particular point with <a href="#windowAt">windowAt</a>().
<p> Many static functions are provided, for example,
<a href="#setKeyboardFilter">setKeyboardFilter</a>(), <a href="#setKeyboardHandler">setKeyboardHandler</a>(), <a href="#setDefaultKeyboard">setDefaultKeyboard</a>()
and <a href="#setDefaultMouse">setDefaultMouse</a>().
<p> The size of the window rectangle can be set with
<a href="#setMaxWindowRect">setMaxWindowRect</a>(), and the desktop's background can be set with
<a href="#setDesktopBackground">setDesktopBackground</a>().
<p> The screen saver is controlled with <a href="#setScreenSaverInterval">setScreenSaverInterval</a>() and
<a href="#screenSaverActivate">screenSaverActivate</a>().
<p>See also <a href="qws.html">Qt/Embedded</a>.
<hr><h2>Member Type Documentation</h2>
<h3 class=fn><a name="GUIMode-enum"></a>QWSServer::GUIMode</h3>
<p> This determines what sort of QWS server to create:
<ul>
<li><tt>QWSServer::NoGui</tt> - This is used for non-graphical Qt applications.
<li><tt>QWSServer::NormalGUI</tt> - A normal Qt/Embedded application (not the server).
<li><tt>QWSServer::Server</tt> - A Qt/Embedded server (e.g. if <tt>-qws</tt> has been specified
on the command line.
</ul>
<h3 class=fn><a name="ServerFlags-enum"></a>QWSServer::ServerFlags</h3>
<p> This enum is used to pass various options to the window system
server.
<ul>
<li><tt>QWSServer::DisableKeyboard</tt> - Ignore all keyboard input.
<li><tt>QWSServer::DisableMouse</tt> - Ignore all mouse input.
</ul>
<h3 class=fn><a name="WindowEvent-enum"></a>QWSServer::WindowEvent</h3>
<p> This specifies what sort of event has occurred to a top-level window:
<ul>
<li><tt>QWSServer::Create</tt> - A new window has been created (<a href="qwidget.html">QWidget</a> constructor).
<li><tt>QWSServer::Destroy</tt> - The window has been closed and deleted (QWidget destructor).
<li><tt>QWSServer::Hide</tt> - The window has been hidden with <a href="qwidget.html#hide">QWidget::hide</a>().
<li><tt>QWSServer::Show</tt> - The window has been shown with <a href="qwidget.html#show">QWidget::show</a>() or similar.
<li><tt>QWSServer::Raise</tt> - The window has been raised to the top of the desktop.
<li><tt>QWSServer::Lower</tt> - The window has been lowered.
<li><tt>QWSServer::Geometry</tt> - The window has changed size or position.
<li><tt>QWSServer::Active</tt> - The window has become the active window (has <a href="focus.html#keyboard-focus">keyboard focus</a>).
<li><tt>QWSServer::Name</tt> - The window has been named.
</ul>
<hr><h2>Member Function Documentation</h2>
<h3 class=fn><a name="QWSServer"></a>QWSServer::QWSServer ( int flags = 0, <a href="qobject.html">QObject</a> * parent = 0, const char * name = 0 )
</h3>
Construct a QWSServer object.
<p> <b>Warning:</b> This class is instantiated by <a href="qapplication.html">QApplication</a> for
Qt/Embedded server processes. You should never construct this
class yourself.
<p> The <em>flags</em> are used for keyboard and mouse setting. The server's
parent is <em>parent</em> and it is called <em>name</em>.
<h3 class=fn><a name="~QWSServer"></a>QWSServer::~QWSServer ()
</h3>
Destruct QWSServer
<h3 class=fn>const <a href="qptrlist.html">QPtrList</a><QWSWindow> & <a name="clientWindows"></a>QWSServer::clientWindows ()
</h3>
<p> Returns the list of top-level windows. This list will change as
applications add and remove wigdets so it should not be stored for
future use. The windows are sorted in stacking order from
top-most to bottom-most.
<h3 class=fn>void <a name="closeKeyboard"></a>QWSServer::closeKeyboard ()
</h3>
Closes keyboard device(s).
<h3 class=fn>void <a name="closeMouse"></a>QWSServer::closeMouse ()
</h3>
Closes the pointer device(s).
<h3 class=fn>void <a name="enablePainting"></a>QWSServer::enablePainting ( bool e )
</h3>
If <em>e</em> is TRUE, painting on the display is enabled; if <em>e</em> is
FALSE, painting is disabled.
<h3 class=fn>bool <a name="isCursorVisible"></a>QWSServer::isCursorVisible ()<tt> [static]</tt>
</h3>
Returns TRUE if the cursor is visible; otherwise returns FALSE.
<p> <p>See also <a href="#setCursorVisible">setCursorVisible</a>().
<h3 class=fn>const KeyMap * <a name="keyMap"></a>QWSServer::keyMap ()<tt> [static]</tt>
</h3>
<p> Returns the keyboard mapping table used to convert keyboard
scancodes to Qt keycodes and Unicode values. It's used by the
keyboard driver in <tt>qkeyboard_qws.cpp</tt>.
<h3 class=fn><a href="qwskeyboardhandler.html">QWSKeyboardHandler</a> * <a name="keyboardHandler"></a>QWSServer::keyboardHandler ()<tt> [static]</tt>
</h3>
Returns the primary keyboard handler.
<h3 class=fn>QWSPropertyManager * <a name="manager"></a>QWSServer::manager ()
</h3>
<p> Returns the QWSPropertyManager, which is used for implementing
X11-style window properties.
<h3 class=fn><a href="qwsmousehandler.html">QWSMouseHandler</a> * <a name="mouseHandler"></a>QWSServer::mouseHandler ()<tt> [static]</tt>
</h3>
Returns the primary mouse handler.
<h3 class=fn>void <a name="newChannel"></a>QWSServer::newChannel ( const <a href="qstring.html">QString</a> & channel )<tt> [signal]</tt>
</h3>
<p> This signal is emitted when the <a href="qcopchannel.html">QCopChannel</a> <em>channel</em> is created.
<h3 class=fn>void <a name="openKeyboard"></a>QWSServer::openKeyboard ()
</h3>
Opens the keyboard device(s).
<h3 class=fn>void <a name="openMouse"></a>QWSServer::openMouse ()
</h3>
Opens the mouse device(s).
<h3 class=fn>void <a name="refresh"></a>QWSServer::refresh ()
</h3>
Refreshes the entire display.
<h3 class=fn>void <a name="refresh-2"></a>QWSServer::refresh ( <a href="qregion.html">QRegion</a> & r )
</h3>
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
<p> Refreshes the region <em>r</em>.
<h3 class=fn>void <a name="removedChannel"></a>QWSServer::removedChannel ( const <a href="qstring.html">QString</a> & channel )<tt> [signal]</tt>
</h3>
<p> This signal is emitted immediately after the <a href="qcopchannel.html">QCopChannel</a> <em>channel</em> is destroyed. Note that a channel is not destroyed until
all its listeners have unregistered.
<h3 class=fn>void <a name="screenSaverActivate"></a>QWSServer::screenSaverActivate ( bool activate )<tt> [static]</tt>
</h3>
If <em>activate</em> is TRUE the screensaver is activated immediately;
if <em>activate</em> is FALSE the screensaver is deactivated.
<h3 class=fn>bool <a name="screenSaverActive"></a>QWSServer::screenSaverActive ()<tt> [static]</tt>
</h3>
Returns TRUE if the screensaver is active (i.e. the screen is
blanked); otherwise returns FALSE.
<h3 class=fn>void <a name="sendIMEvent"></a>QWSServer::sendIMEvent ( IMState state, const <a href="qstring.html">QString</a> & txt, int cpos, int selLen )
</h3>
This function sends an input method event to the server. The
current state is passed in <em>state</em> and the current text in <em>txt</em>. The cursor's position in the text is given by <em>cpos</em>, and
the selection length (which could be 0) is given in <em>selLen</em>.
<h3 class=fn>void <a name="sendKeyEvent"></a>QWSServer::sendKeyEvent ( int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat )<tt> [static]</tt>
</h3>
Send a key event. You can use this to send key events generated by
"virtual keyboards". <em>unicode</em> is the Unicode value of the key to
send, <em>keycode</em> the Qt keycode (e.g. <tt>Key_Left</tt>), <em>modifiers</em>
indicates whether, Shift/Alt/Ctrl keys are pressed, <em>isPress</em> is
TRUE if this is a key down event and FALSE if it's a key up event,
and <em>autoRepeat</em> is TRUE if this is an autorepeat event (i.e. the
user has held the key down and this is the second or subsequent
key event being sent).
<h3 class=fn>void <a name="setCursorVisible"></a>QWSServer::setCursorVisible ( bool vis )<tt> [static]</tt>
</h3>
If <em>vis</em> is TRUE, makes the cursor visible; if <em>vis</em> is FALSE,
makes the cursor invisible.
<p> <p>See also <a href="#isCursorVisible">isCursorVisible</a>().
<h3 class=fn>void <a name="setDefaultKeyboard"></a>QWSServer::setDefaultKeyboard ( const char * k )<tt> [static]</tt>
</h3>
Set the keyboard driver to <em>k</em>, e.g. if <tt>$QWS_KEYBOARD</tt> is not
defined. The default is platform-dependent.
<h3 class=fn>void <a name="setDefaultMouse"></a>QWSServer::setDefaultMouse ( const char * m )<tt> [static]</tt>
</h3>
Set the mouse driver <em>m</em> to use if <tt>$QWS_MOUSE_PROTO</tt> is not
defined. The default is platform-dependent.
<h3 class=fn>void <a name="setDesktopBackground"></a>QWSServer::setDesktopBackground ( const <a href="qimage.html">QImage</a> & img )<tt> [static]</tt>
</h3>
Sets the image <em>img</em> to be used as the background in the absence
of obscuring windows.
<h3 class=fn>void <a name="setDesktopBackground-2"></a>QWSServer::setDesktopBackground ( const <a href="qcolor.html">QColor</a> & c )<tt> [static]</tt>
</h3>
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
<p> Sets the color <em>c</em> to be used as the background in the absence of
obscuring windows.
<h3 class=fn>void <a name="setKeyboardFilter"></a>QWSServer::setKeyboardFilter ( <a href="qwsserver::keyboardfilter.html">KeyboardFilter</a> * f )<tt> [static]</tt>
</h3>
Adds a filter <em>f</em> to be invoked for all key events from physical
keyboard drivers (events sent via processKeyEvent()).
<p> The filter is not invoked for keys generated by virtual keyboard
drivers (events sent via <a href="#sendKeyEvent">sendKeyEvent</a>()).
<p> If <em>f</em> is 0, the most-recently added filter is removed and deleted.
The caller is responsible for matching each addition with a
corresponding removal.
<h3 class=fn>void <a name="setKeyboardHandler"></a>QWSServer::setKeyboardHandler ( <a href="qwskeyboardhandler.html">QWSKeyboardHandler</a> * kh )<tt> [static]</tt>
</h3>
Sets the primary keyboard handler to <em>kh</em>.
<h3 class=fn>void <a name="setMaxWindowRect"></a>QWSServer::setMaxWindowRect ( const <a href="qrect.html">QRect</a> & r )<tt> [static]</tt>
</h3>
Sets the area of the screen which Qt/Embedded applications will
consider to be the maximum area to use for windows to <em>r</em>.
<p> <p>See also <a href="qwidget.html#showMaximized">QWidget::showMaximized</a>().
<h3 class=fn>void <a name="setScreenSaverInterval"></a>QWSServer::setScreenSaverInterval ( int ms )<tt> [static]</tt>
</h3>
Sets the timeout for the screensaver to <em>ms</em> milliseconds. A
setting of zero turns off the screensaver.
<h3 class=fn>void <a name="setScreenSaverIntervals"></a>QWSServer::setScreenSaverIntervals ( int * ms )<tt> [static]</tt>
</h3>
Sets an array of timeouts for the screensaver to a list of <em>ms</em>
milliseconds. A setting of zero turns off the screensaver. The
array must be 0-terminated.
<h3 class=fn><a href="qwswindow.html">QWSWindow</a> * <a name="windowAt"></a>QWSServer::windowAt ( const <a href="qpoint.html">QPoint</a> & pos )
</h3>
Returns the window containing the point <em>pos</em> or 0 if there is no
window under the point.
<h3 class=fn>void <a name="windowEvent"></a>QWSServer::windowEvent ( <a href="qwswindow.html">QWSWindow</a> * w, <a href="qwsserver.html#WindowEvent-enum">QWSServer::WindowEvent</a> e )<tt> [signal]</tt>
</h3>
<p> This signal is emitted whenever something happens to a top-level
window (e.g. it's created or destroyed). <em>w</em> is the window to
which the event of type <em>e</em> has occurred.
<!-- eof -->
<hr><p>
This file is part of the <a href="index.html">Qt toolkit</a>.
Copyright © 1995-2007
<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
<table width=100% cellspacing=0 border=0><tr>
<td>Copyright © 2007
<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
<td align=right><div align=right>Qt 3.3.8</div>
</table></div></address></body>
</html>
|