source: trunk/doc/html/qwsserver.html@ 190

Last change on this file since 190 was 190, checked in by rudi, 14 years ago

reference documentation added

File size: 19.1 KB
Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2<!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/kernel/qwindowsystem_qws.cpp:856 -->
3<html>
4<head>
5<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
6<title>QWSServer Class</title>
7<style type="text/css"><!--
8fn { margin-left: 1cm; text-indent: -1cm; }
9a:link { color: #004faf; text-decoration: none }
10a:visited { color: #672967; text-decoration: none }
11body { background: #ffffff; color: black; }
12--></style>
13</head>
14<body>
15
16<table border="0" cellpadding="0" cellspacing="0" width="100%">
17<tr bgcolor="#E5E5E5">
18<td valign=center>
19 <a href="index.html">
20<font color="#004faf">Home</font></a>
21 | <a href="classes.html">
22<font color="#004faf">All&nbsp;Classes</font></a>
23 | <a href="mainclasses.html">
24<font color="#004faf">Main&nbsp;Classes</font></a>
25 | <a href="annotated.html">
26<font color="#004faf">Annotated</font></a>
27 | <a href="groups.html">
28<font color="#004faf">Grouped&nbsp;Classes</font></a>
29 | <a href="functions.html">
30<font color="#004faf">Functions</font></a>
31</td>
32<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>
33
34<p>The QWSServer class provides server-specific functionality in Qt/Embedded.
35<a href="#details">More...</a>
36<p><tt>#include &lt;<a href="qwindowsystem_qws-h.html">qwindowsystem_qws.h</a>&gt;</tt>
37<p><a href="qwsserver-members.html">List of all member functions.</a>
38<h2>Public Members</h2>
39<ul>
40<li class=fn><a href="#QWSServer"><b>QWSServer</b></a> ( int&nbsp;flags = 0, QObject&nbsp;*&nbsp;parent = 0, const&nbsp;char&nbsp;*&nbsp;name = 0 )</li>
41<li class=fn><a href="#~QWSServer"><b>~QWSServer</b></a> ()</li>
42<li class=fn>enum <a href="#ServerFlags-enum"><b>ServerFlags</b></a> { DisableKeyboard = 0x01, DisableMouse = 0x02 }</li>
43<li class=fn>enum <a href="#GUIMode-enum"><b>GUIMode</b></a> { NoGui = FALSE, NormalGUI = TRUE, Server }</li>
44<li class=fn>void <a href="#sendIMEvent"><b>sendIMEvent</b></a> ( IMState&nbsp;state, const&nbsp;QString&nbsp;&amp;&nbsp;txt, int&nbsp;cpos, int&nbsp;selLen )</li>
45<li class=fn>class <b>KeyMap</b> { }</li>
46<li class=fn>class <b>KeyOverride</b> { }</li>
47<li class=fn>class <a href="#KeyboardFilter"><b>KeyboardFilter</b></a> { }</li>
48<li class=fn>QWSWindow * <a href="#windowAt"><b>windowAt</b></a> ( const&nbsp;QPoint&nbsp;&amp;&nbsp;pos )</li>
49<li class=fn>const QPtrList&lt;QWSWindow&gt; &amp; <a href="#clientWindows"><b>clientWindows</b></a> ()</li>
50<li class=fn>void <a href="#openMouse"><b>openMouse</b></a> ()</li>
51<li class=fn>void <a href="#closeMouse"><b>closeMouse</b></a> ()</li>
52<li class=fn>void <a href="#openKeyboard"><b>openKeyboard</b></a> ()</li>
53<li class=fn>void <a href="#closeKeyboard"><b>closeKeyboard</b></a> ()</li>
54<li class=fn>void <a href="#refresh"><b>refresh</b></a> ()</li>
55<li class=fn>void <a href="#refresh-2"><b>refresh</b></a> ( QRegion&nbsp;&amp;&nbsp;r )</li>
56<li class=fn>void <a href="#enablePainting"><b>enablePainting</b></a> ( bool&nbsp;e )</li>
57<li class=fn>QWSPropertyManager * <a href="#manager"><b>manager</b></a> ()</li>
58<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>
59</ul>
60<h2>Signals</h2>
61<ul>
62<li class=fn>void <a href="#windowEvent"><b>windowEvent</b></a> ( QWSWindow&nbsp;*&nbsp;w, QWSServer::WindowEvent&nbsp;e )</li>
63<li class=fn>void <a href="#newChannel"><b>newChannel</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;channel )</li>
64<li class=fn>void <a href="#removedChannel"><b>removedChannel</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;channel )</li>
65</ul>
66<h2>Static Public Members</h2>
67<ul>
68<li class=fn>void <a href="#sendKeyEvent"><b>sendKeyEvent</b></a> ( int&nbsp;unicode, int&nbsp;keycode, int&nbsp;modifiers, bool&nbsp;isPress, bool&nbsp;autoRepeat )</li>
69<li class=fn>const KeyMap * <a href="#keyMap"><b>keyMap</b></a> ()</li>
70<li class=fn>void <b>setOverrideKeys</b> ( const KeyOverride * )</li>
71<li class=fn>void <a href="#setKeyboardFilter"><b>setKeyboardFilter</b></a> ( KeyboardFilter&nbsp;*&nbsp;f )</li>
72<li class=fn>void <a href="#setDefaultMouse"><b>setDefaultMouse</b></a> ( const&nbsp;char&nbsp;*&nbsp;m )</li>
73<li class=fn>void <a href="#setDefaultKeyboard"><b>setDefaultKeyboard</b></a> ( const&nbsp;char&nbsp;*&nbsp;k )</li>
74<li class=fn>void <a href="#setMaxWindowRect"><b>setMaxWindowRect</b></a> ( const&nbsp;QRect&nbsp;&amp;&nbsp;r )</li>
75<li class=fn>void <a href="#setDesktopBackground"><b>setDesktopBackground</b></a> ( const&nbsp;QImage&nbsp;&amp;&nbsp;img )</li>
76<li class=fn>void <a href="#setDesktopBackground-2"><b>setDesktopBackground</b></a> ( const&nbsp;QColor&nbsp;&amp;&nbsp;c )</li>
77<li class=fn>QWSMouseHandler * <a href="#mouseHandler"><b>mouseHandler</b></a> ()</li>
78<li class=fn>QWSKeyboardHandler * <a href="#keyboardHandler"><b>keyboardHandler</b></a> ()</li>
79<li class=fn>void <a href="#setKeyboardHandler"><b>setKeyboardHandler</b></a> ( QWSKeyboardHandler&nbsp;*&nbsp;kh )</li>
80<li class=fn>void <a href="#setScreenSaverIntervals"><b>setScreenSaverIntervals</b></a> ( int&nbsp;*&nbsp;ms )</li>
81<li class=fn>void <a href="#setScreenSaverInterval"><b>setScreenSaverInterval</b></a> ( int&nbsp;ms )</li>
82<li class=fn>bool <a href="#screenSaverActive"><b>screenSaverActive</b></a> ()</li>
83<li class=fn>void <a href="#screenSaverActivate"><b>screenSaverActivate</b></a> ( bool&nbsp;activate )</li>
84<li class=fn>void <a href="#setCursorVisible"><b>setCursorVisible</b></a> ( bool&nbsp;vis )</li>
85<li class=fn>bool <a href="#isCursorVisible"><b>isCursorVisible</b></a> ()</li>
86</ul>
87<hr><a name="details"></a><h2>Detailed Description</h2>
88
89
90The QWSServer class provides server-specific functionality in Qt/Embedded.
91<p>
92<p> When you run a Qt/Embedded application, it either runs as a server
93or connects to an existing server. If it runs as a server, some
94additional operations are provided by this class.
95<p> This class is instantiated by <a href="qapplication.html">QApplication</a> for Qt/Embedded server
96processes. You should never construct this class yourself.
97<p> A pointer to the QWSServer instance can be obtained via the global
98<tt>qwsServer</tt> variable.
99<p> The mouse and keyboard devices can be opened with <a href="#openMouse">openMouse</a>() and
100<a href="#openKeyboard">openKeyboard</a>(). (Close them with <a href="#closeMouse">closeMouse</a>() and
101<a href="#closeKeyboard">closeKeyboard</a>().)
102<p> The display is refreshed with <a href="#refresh">refresh</a>(), and painting can be
103enabled or disabled with <a href="#enablePainting">enablePainting</a>().
104<p> Obtain the list of client windows with <a href="#clientWindows">clientWindows</a>() and find
105out which window is at a particular point with <a href="#windowAt">windowAt</a>().
106<p> Many static functions are provided, for example,
107<a href="#setKeyboardFilter">setKeyboardFilter</a>(), <a href="#setKeyboardHandler">setKeyboardHandler</a>(), <a href="#setDefaultKeyboard">setDefaultKeyboard</a>()
108and <a href="#setDefaultMouse">setDefaultMouse</a>().
109<p> The size of the window rectangle can be set with
110<a href="#setMaxWindowRect">setMaxWindowRect</a>(), and the desktop's background can be set with
111<a href="#setDesktopBackground">setDesktopBackground</a>().
112<p> The screen saver is controlled with <a href="#setScreenSaverInterval">setScreenSaverInterval</a>() and
113<a href="#screenSaverActivate">screenSaverActivate</a>().
114<p>See also <a href="qws.html">Qt/Embedded</a>.
115
116<hr><h2>Member Type Documentation</h2>
117<h3 class=fn><a name="GUIMode-enum"></a>QWSServer::GUIMode</h3>
118
119<p> This determines what sort of QWS server to create:
120<ul>
121<li><tt>QWSServer::NoGui</tt> - This is used for non-graphical Qt applications.
122<li><tt>QWSServer::NormalGUI</tt> - A normal Qt/Embedded application (not the server).
123<li><tt>QWSServer::Server</tt> - A Qt/Embedded server (e.g. if <tt>-qws</tt> has been specified
124on the command line.
125</ul>
126<h3 class=fn><a name="ServerFlags-enum"></a>QWSServer::ServerFlags</h3>
127
128<p> This enum is used to pass various options to the window system
129server.
130<ul>
131<li><tt>QWSServer::DisableKeyboard</tt> - Ignore all keyboard input.
132<li><tt>QWSServer::DisableMouse</tt> - Ignore all mouse input.
133</ul>
134<h3 class=fn><a name="WindowEvent-enum"></a>QWSServer::WindowEvent</h3>
135
136<p> This specifies what sort of event has occurred to a top-level window:
137<ul>
138<li><tt>QWSServer::Create</tt> - A new window has been created (<a href="qwidget.html">QWidget</a> constructor).
139<li><tt>QWSServer::Destroy</tt> - The window has been closed and deleted (QWidget destructor).
140<li><tt>QWSServer::Hide</tt> - The window has been hidden with <a href="qwidget.html#hide">QWidget::hide</a>().
141<li><tt>QWSServer::Show</tt> - The window has been shown with <a href="qwidget.html#show">QWidget::show</a>() or similar.
142<li><tt>QWSServer::Raise</tt> - The window has been raised to the top of the desktop.
143<li><tt>QWSServer::Lower</tt> - The window has been lowered.
144<li><tt>QWSServer::Geometry</tt> - The window has changed size or position.
145<li><tt>QWSServer::Active</tt> - The window has become the active window (has <a href="focus.html#keyboard-focus">keyboard focus</a>).
146<li><tt>QWSServer::Name</tt> - The window has been named.
147</ul>
148<hr><h2>Member Function Documentation</h2>
149<h3 class=fn><a name="QWSServer"></a>QWSServer::QWSServer ( int&nbsp;flags = 0, <a href="qobject.html">QObject</a>&nbsp;*&nbsp;parent = 0, const&nbsp;char&nbsp;*&nbsp;name = 0 )
150</h3>
151Construct a QWSServer object.
152<p> <b>Warning:</b> This class is instantiated by <a href="qapplication.html">QApplication</a> for
153Qt/Embedded server processes. You should never construct this
154class yourself.
155<p> The <em>flags</em> are used for keyboard and mouse setting. The server's
156parent is <em>parent</em> and it is called <em>name</em>.
157
158<h3 class=fn><a name="~QWSServer"></a>QWSServer::~QWSServer ()
159</h3>
160Destruct QWSServer
161
162<h3 class=fn>const&nbsp;<a href="qptrlist.html">QPtrList</a>&lt;QWSWindow&gt;&nbsp;&amp; <a name="clientWindows"></a>QWSServer::clientWindows ()
163</h3>
164
165<p> Returns the list of top-level windows. This list will change as
166applications add and remove wigdets so it should not be stored for
167future use. The windows are sorted in stacking order from
168top-most to bottom-most.
169
170<h3 class=fn>void <a name="closeKeyboard"></a>QWSServer::closeKeyboard ()
171</h3>
172Closes keyboard device(s).
173
174<h3 class=fn>void <a name="closeMouse"></a>QWSServer::closeMouse ()
175</h3>
176Closes the pointer device(s).
177
178<h3 class=fn>void <a name="enablePainting"></a>QWSServer::enablePainting ( bool&nbsp;e )
179</h3>
180If <em>e</em> is TRUE, painting on the display is enabled; if <em>e</em> is
181FALSE, painting is disabled.
182
183<h3 class=fn>bool <a name="isCursorVisible"></a>QWSServer::isCursorVisible ()<tt> [static]</tt>
184</h3>
185Returns TRUE if the cursor is visible; otherwise returns FALSE.
186<p> <p>See also <a href="#setCursorVisible">setCursorVisible</a>().
187
188<h3 class=fn>const KeyMap * <a name="keyMap"></a>QWSServer::keyMap ()<tt> [static]</tt>
189</h3>
190
191<p> Returns the keyboard mapping table used to convert keyboard
192scancodes to Qt keycodes and Unicode values. It's used by the
193keyboard driver in <tt>qkeyboard_qws.cpp</tt>.
194
195<h3 class=fn><a href="qwskeyboardhandler.html">QWSKeyboardHandler</a>&nbsp;* <a name="keyboardHandler"></a>QWSServer::keyboardHandler ()<tt> [static]</tt>
196</h3>
197Returns the primary keyboard handler.
198
199<h3 class=fn>QWSPropertyManager * <a name="manager"></a>QWSServer::manager ()
200</h3>
201
202<p> Returns the QWSPropertyManager, which is used for implementing
203X11-style window properties.
204
205<h3 class=fn><a href="qwsmousehandler.html">QWSMouseHandler</a>&nbsp;* <a name="mouseHandler"></a>QWSServer::mouseHandler ()<tt> [static]</tt>
206</h3>
207Returns the primary mouse handler.
208
209<h3 class=fn>void <a name="newChannel"></a>QWSServer::newChannel ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;channel )<tt> [signal]</tt>
210</h3>
211
212<p> This signal is emitted when the <a href="qcopchannel.html">QCopChannel</a> <em>channel</em> is created.
213
214<h3 class=fn>void <a name="openKeyboard"></a>QWSServer::openKeyboard ()
215</h3>
216Opens the keyboard device(s).
217
218<h3 class=fn>void <a name="openMouse"></a>QWSServer::openMouse ()
219</h3>
220Opens the mouse device(s).
221
222<h3 class=fn>void <a name="refresh"></a>QWSServer::refresh ()
223</h3>
224Refreshes the entire display.
225
226<h3 class=fn>void <a name="refresh-2"></a>QWSServer::refresh ( <a href="qregion.html">QRegion</a>&nbsp;&amp;&nbsp;r )
227</h3>
228This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
229<p> Refreshes the region <em>r</em>.
230
231<h3 class=fn>void <a name="removedChannel"></a>QWSServer::removedChannel ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;channel )<tt> [signal]</tt>
232</h3>
233
234<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
235all its listeners have unregistered.
236
237<h3 class=fn>void <a name="screenSaverActivate"></a>QWSServer::screenSaverActivate ( bool&nbsp;activate )<tt> [static]</tt>
238</h3>
239If <em>activate</em> is TRUE the screensaver is activated immediately;
240if <em>activate</em> is FALSE the screensaver is deactivated.
241
242<h3 class=fn>bool <a name="screenSaverActive"></a>QWSServer::screenSaverActive ()<tt> [static]</tt>
243</h3>
244Returns TRUE if the screensaver is active (i.e. the screen is
245blanked); otherwise returns FALSE.
246
247<h3 class=fn>void <a name="sendIMEvent"></a>QWSServer::sendIMEvent ( IMState&nbsp;state, const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;txt, int&nbsp;cpos, int&nbsp;selLen )
248</h3>
249This function sends an input method event to the server. The
250current 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
251the selection length (which could be 0) is given in <em>selLen</em>.
252
253<h3 class=fn>void <a name="sendKeyEvent"></a>QWSServer::sendKeyEvent ( int&nbsp;unicode, int&nbsp;keycode, int&nbsp;modifiers, bool&nbsp;isPress, bool&nbsp;autoRepeat )<tt> [static]</tt>
254</h3>
255Send a key event. You can use this to send key events generated by
256"virtual keyboards". <em>unicode</em> is the Unicode value of the key to
257send, <em>keycode</em> the Qt keycode (e.g. <tt>Key_Left</tt>), <em>modifiers</em>
258indicates whether, Shift/Alt/Ctrl keys are pressed, <em>isPress</em> is
259TRUE if this is a key down event and FALSE if it's a key up event,
260and <em>autoRepeat</em> is TRUE if this is an autorepeat event (i.e. the
261user has held the key down and this is the second or subsequent
262key event being sent).
263
264<h3 class=fn>void <a name="setCursorVisible"></a>QWSServer::setCursorVisible ( bool&nbsp;vis )<tt> [static]</tt>
265</h3>
266If <em>vis</em> is TRUE, makes the cursor visible; if <em>vis</em> is FALSE,
267makes the cursor invisible.
268<p> <p>See also <a href="#isCursorVisible">isCursorVisible</a>().
269
270<h3 class=fn>void <a name="setDefaultKeyboard"></a>QWSServer::setDefaultKeyboard ( const&nbsp;char&nbsp;*&nbsp;k )<tt> [static]</tt>
271</h3>
272Set the keyboard driver to <em>k</em>, e.g. if <tt>$QWS_KEYBOARD</tt> is not
273defined. The default is platform-dependent.
274
275<h3 class=fn>void <a name="setDefaultMouse"></a>QWSServer::setDefaultMouse ( const&nbsp;char&nbsp;*&nbsp;m )<tt> [static]</tt>
276</h3>
277Set the mouse driver <em>m</em> to use if <tt>$QWS_MOUSE_PROTO</tt> is not
278defined. The default is platform-dependent.
279
280<h3 class=fn>void <a name="setDesktopBackground"></a>QWSServer::setDesktopBackground ( const&nbsp;<a href="qimage.html">QImage</a>&nbsp;&amp;&nbsp;img )<tt> [static]</tt>
281</h3>
282Sets the image <em>img</em> to be used as the background in the absence
283of obscuring windows.
284
285<h3 class=fn>void <a name="setDesktopBackground-2"></a>QWSServer::setDesktopBackground ( const&nbsp;<a href="qcolor.html">QColor</a>&nbsp;&amp;&nbsp;c )<tt> [static]</tt>
286</h3>
287This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
288<p> Sets the color <em>c</em> to be used as the background in the absence of
289obscuring windows.
290
291<h3 class=fn>void <a name="setKeyboardFilter"></a>QWSServer::setKeyboardFilter ( <a href="qwsserver::keyboardfilter.html">KeyboardFilter</a>&nbsp;*&nbsp;f )<tt> [static]</tt>
292</h3>
293Adds a filter <em>f</em> to be invoked for all key events from physical
294keyboard drivers (events sent via processKeyEvent()).
295<p> The filter is not invoked for keys generated by virtual keyboard
296drivers (events sent via <a href="#sendKeyEvent">sendKeyEvent</a>()).
297<p> If <em>f</em> is 0, the most-recently added filter is removed and deleted.
298The caller is responsible for matching each addition with a
299corresponding removal.
300
301<h3 class=fn>void <a name="setKeyboardHandler"></a>QWSServer::setKeyboardHandler ( <a href="qwskeyboardhandler.html">QWSKeyboardHandler</a>&nbsp;*&nbsp;kh )<tt> [static]</tt>
302</h3>
303Sets the primary keyboard handler to <em>kh</em>.
304
305<h3 class=fn>void <a name="setMaxWindowRect"></a>QWSServer::setMaxWindowRect ( const&nbsp;<a href="qrect.html">QRect</a>&nbsp;&amp;&nbsp;r )<tt> [static]</tt>
306</h3>
307Sets the area of the screen which Qt/Embedded applications will
308consider to be the maximum area to use for windows to <em>r</em>.
309<p> <p>See also <a href="qwidget.html#showMaximized">QWidget::showMaximized</a>().
310
311<h3 class=fn>void <a name="setScreenSaverInterval"></a>QWSServer::setScreenSaverInterval ( int&nbsp;ms )<tt> [static]</tt>
312</h3>
313Sets the timeout for the screensaver to <em>ms</em> milliseconds. A
314setting of zero turns off the screensaver.
315
316<h3 class=fn>void <a name="setScreenSaverIntervals"></a>QWSServer::setScreenSaverIntervals ( int&nbsp;*&nbsp;ms )<tt> [static]</tt>
317</h3>
318Sets an array of timeouts for the screensaver to a list of <em>ms</em>
319milliseconds. A setting of zero turns off the screensaver. The
320array must be 0-terminated.
321
322<h3 class=fn><a href="qwswindow.html">QWSWindow</a>&nbsp;* <a name="windowAt"></a>QWSServer::windowAt ( const&nbsp;<a href="qpoint.html">QPoint</a>&nbsp;&amp;&nbsp;pos )
323</h3>
324Returns the window containing the point <em>pos</em> or 0 if there is no
325window under the point.
326
327<h3 class=fn>void <a name="windowEvent"></a>QWSServer::windowEvent ( <a href="qwswindow.html">QWSWindow</a>&nbsp;*&nbsp;w, <a href="qwsserver.html#WindowEvent-enum">QWSServer::WindowEvent</a>&nbsp;e )<tt> [signal]</tt>
328</h3>
329
330<p> This signal is emitted whenever something happens to a top-level
331window (e.g. it's created or destroyed). <em>w</em> is the window to
332which the event of type <em>e</em> has occurred.
333
334<!-- eof -->
335<hr><p>
336This file is part of the <a href="index.html">Qt toolkit</a>.
337Copyright &copy; 1995-2007
338<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
339<table width=100% cellspacing=0 border=0><tr>
340<td>Copyright &copy; 2007
341<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
342<td align=right><div align=right>Qt 3.3.8</div>
343</table></div></address></body>
344</html>
Note: See TracBrowser for help on using the repository browser.