You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
tqt3/doc/man/man3/qwsserver.3qt

312 lines
13 KiB

'\" t
.TH QWSServer 3qt "2 February 2007" "Trolltech AS" \" -*- nroff -*-
.\" Copyright 1992-2007 Trolltech ASA. All rights reserved. See the
.\" license file included in the distribution for a complete license
.\" statement.
.\"
.ad l
.nh
.SH NAME
QWSServer \- Server-specific functionality in Qt/Embedded
.SH SYNOPSIS
\fC#include <qwindowsystem_qws.h>\fR
.PP
.SS "Public Members"
.in +1c
.ti -1c
.BI "\fBQWSServer\fR ( int flags = 0, QObject * parent = 0, const char * name = 0 )"
.br
.ti -1c
.BI "\fB~QWSServer\fR ()"
.br
.ti -1c
.BI "enum \fBServerFlags\fR { DisableKeyboard = 0x01, DisableMouse = 0x02 }"
.br
.ti -1c
.BI "enum \fBGUIMode\fR { NoGui = FALSE, NormalGUI = TRUE, Server }"
.br
.ti -1c
.BI "void \fBsendIMEvent\fR ( IMState state, const QString & txt, int cpos, int selLen )"
.br
.ti -1c
.BI "class \fBKeyMap\fR { }"
.br
.ti -1c
.BI "class \fBKeyOverride\fR { }"
.br
.ti -1c
.BI "class \fBKeyboardFilter\fR { }"
.br
.ti -1c
.BI "QWSWindow * \fBwindowAt\fR ( const QPoint & pos )"
.br
.ti -1c
.BI "const QPtrList<QWSWindow> & \fBclientWindows\fR ()"
.br
.ti -1c
.BI "void \fBopenMouse\fR ()"
.br
.ti -1c
.BI "void \fBcloseMouse\fR ()"
.br
.ti -1c
.BI "void \fBopenKeyboard\fR ()"
.br
.ti -1c
.BI "void \fBcloseKeyboard\fR ()"
.br
.ti -1c
.BI "void \fBrefresh\fR ()"
.br
.ti -1c
.BI "void \fBrefresh\fR ( QRegion & r )"
.br
.ti -1c
.BI "void \fBenablePainting\fR ( bool e )"
.br
.ti -1c
.BI "QWSPropertyManager * \fBmanager\fR ()"
.br
.ti -1c
.BI "enum \fBWindowEvent\fR { Create = 0x0001, Destroy = 0x0002, Hide = 0x0004, Show = 0x0008, Raise = 0x0010, Lower = 0x0020, Geometry = 0x0040, Active = 0x0080, Name = 0x0100 }"
.br
.in -1c
.SS "Signals"
.in +1c
.ti -1c
.BI "void \fBwindowEvent\fR ( QWSWindow * w, QWSServer::WindowEvent e )"
.br
.ti -1c
.BI "void \fBnewChannel\fR ( const QString & channel )"
.br
.ti -1c
.BI "void \fBremovedChannel\fR ( const QString & channel )"
.br
.in -1c
.SS "Static Public Members"
.in +1c
.ti -1c
.BI "void \fBsendKeyEvent\fR ( int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat )"
.br
.ti -1c
.BI "const KeyMap * \fBkeyMap\fR ()"
.br
.ti -1c
.BI "void \fBsetOverrideKeys\fR ( const KeyOverride * )"
.br
.ti -1c
.BI "void \fBsetKeyboardFilter\fR ( KeyboardFilter * f )"
.br
.ti -1c
.BI "void \fBsetDefaultMouse\fR ( const char * m )"
.br
.ti -1c
.BI "void \fBsetDefaultKeyboard\fR ( const char * k )"
.br
.ti -1c
.BI "void \fBsetMaxWindowRect\fR ( const QRect & r )"
.br
.ti -1c
.BI "void \fBsetDesktopBackground\fR ( const QImage & img )"
.br
.ti -1c
.BI "void \fBsetDesktopBackground\fR ( const QColor & c )"
.br
.ti -1c
.BI "QWSMouseHandler * \fBmouseHandler\fR ()"
.br
.ti -1c
.BI "QWSKeyboardHandler * \fBkeyboardHandler\fR ()"
.br
.ti -1c
.BI "void \fBsetKeyboardHandler\fR ( QWSKeyboardHandler * kh )"
.br
.ti -1c
.BI "void \fBsetScreenSaverIntervals\fR ( int * ms )"
.br
.ti -1c
.BI "void \fBsetScreenSaverInterval\fR ( int ms )"
.br
.ti -1c
.BI "bool \fBscreenSaverActive\fR ()"
.br
.ti -1c
.BI "void \fBscreenSaverActivate\fR ( bool activate )"
.br
.ti -1c
.BI "void \fBsetCursorVisible\fR ( bool vis )"
.br
.ti -1c
.BI "bool \fBisCursorVisible\fR ()"
.br
.in -1c
.SH DESCRIPTION
The QWSServer class provides server-specific functionality in Qt/Embedded.
.PP
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.
.PP
This class is instantiated by QApplication for Qt/Embedded server processes. You should never construct this class yourself.
.PP
A pointer to the QWSServer instance can be obtained via the global \fCqwsServer\fR variable.
.PP
The mouse and keyboard devices can be opened with openMouse() and openKeyboard(). (Close them with closeMouse() and closeKeyboard().)
.PP
The display is refreshed with refresh(), and painting can be enabled or disabled with enablePainting().
.PP
Obtain the list of client windows with clientWindows() and find out which window is at a particular point with windowAt().
.PP
Many static functions are provided, for example, setKeyboardFilter(), setKeyboardHandler(), setDefaultKeyboard() and setDefaultMouse().
.PP
The size of the window rectangle can be set with setMaxWindowRect(), and the desktop's background can be set with setDesktopBackground().
.PP
The screen saver is controlled with setScreenSaverInterval() and screenSaverActivate().
.PP
See also Qt/Embedded.
.SS "Member Type Documentation"
.SH "QWSServer::GUIMode"
This determines what sort of QWS server to create:
.TP
\fCQWSServer::NoGui\fR - This is used for non-graphical Qt applications.
.TP
\fCQWSServer::NormalGUI\fR - A normal Qt/Embedded application (not the server).
.TP
\fCQWSServer::Server\fR - A Qt/Embedded server (e.g. if \fC-qws\fR has been specified on the command line.
.SH "QWSServer::ServerFlags"
This enum is used to pass various options to the window system server.
.TP
\fCQWSServer::DisableKeyboard\fR - Ignore all keyboard input.
.TP
\fCQWSServer::DisableMouse\fR - Ignore all mouse input.
.SH "QWSServer::WindowEvent"
This specifies what sort of event has occurred to a top-level window:
.TP
\fCQWSServer::Create\fR - A new window has been created (QWidget constructor).
.TP
\fCQWSServer::Destroy\fR - The window has been closed and deleted (QWidget destructor).
.TP
\fCQWSServer::Hide\fR - The window has been hidden with QWidget::hide().
.TP
\fCQWSServer::Show\fR - The window has been shown with QWidget::show() or similar.
.TP
\fCQWSServer::Raise\fR - The window has been raised to the top of the desktop.
.TP
\fCQWSServer::Lower\fR - The window has been lowered.
.TP
\fCQWSServer::Geometry\fR - The window has changed size or position.
.TP
\fCQWSServer::Active\fR - The window has become the active window (has keyboard focus).
.TP
\fCQWSServer::Name\fR - The window has been named.
.SH MEMBER FUNCTION DOCUMENTATION
.SH "QWSServer::QWSServer ( int flags = 0, QObject * parent = 0, const char * name = 0 )"
Construct a QWSServer object.
.PP
\fBWarning:\fR This class is instantiated by QApplication for Qt/Embedded server processes. You should never construct this class yourself.
.PP
The \fIflags\fR are used for keyboard and mouse setting. The server's parent is \fIparent\fR and it is called \fIname\fR.
.SH "QWSServer::~QWSServer ()"
Destruct QWSServer
.SH "const QPtrList<QWSWindow> & QWSServer::clientWindows ()"
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.
.SH "void QWSServer::closeKeyboard ()"
Closes keyboard device(s).
.SH "void QWSServer::closeMouse ()"
Closes the pointer device(s).
.SH "void QWSServer::enablePainting ( bool e )"
If \fIe\fR is TRUE, painting on the display is enabled; if \fIe\fR is FALSE, painting is disabled.
.SH "bool QWSServer::isCursorVisible ()\fC [static]\fR"
Returns TRUE if the cursor is visible; otherwise returns FALSE.
.PP
See also setCursorVisible().
.SH "const KeyMap * QWSServer::keyMap ()\fC [static]\fR"
Returns the keyboard mapping table used to convert keyboard scancodes to Qt keycodes and Unicode values. It's used by the keyboard driver in \fCqkeyboard_qws.cpp\fR.
.SH "QWSKeyboardHandler * QWSServer::keyboardHandler ()\fC [static]\fR"
Returns the primary keyboard handler.
.SH "QWSPropertyManager * QWSServer::manager ()"
Returns the QWSPropertyManager, which is used for implementing X11-style window properties.
.SH "QWSMouseHandler * QWSServer::mouseHandler ()\fC [static]\fR"
Returns the primary mouse handler.
.SH "void QWSServer::newChannel ( const QString & channel )\fC [signal]\fR"
This signal is emitted when the QCopChannel \fIchannel\fR is created.
.SH "void QWSServer::openKeyboard ()"
Opens the keyboard device(s).
.SH "void QWSServer::openMouse ()"
Opens the mouse device(s).
.SH "void QWSServer::refresh ()"
Refreshes the entire display.
.SH "void QWSServer::refresh ( QRegion & r )"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Refreshes the region \fIr\fR.
.SH "void QWSServer::removedChannel ( const QString & channel )\fC [signal]\fR"
This signal is emitted immediately after the QCopChannel \fIchannel\fR is destroyed. Note that a channel is not destroyed until all its listeners have unregistered.
.SH "void QWSServer::screenSaverActivate ( bool activate )\fC [static]\fR"
If \fIactivate\fR is TRUE the screensaver is activated immediately; if \fIactivate\fR is FALSE the screensaver is deactivated.
.SH "bool QWSServer::screenSaverActive ()\fC [static]\fR"
Returns TRUE if the screensaver is active (i.e. the screen is blanked); otherwise returns FALSE.
.SH "void QWSServer::sendIMEvent ( IMState state, const QString & txt, int cpos, int selLen )"
This function sends an input method event to the server. The current state is passed in \fIstate\fR and the current text in \fItxt\fR. The cursor's position in the text is given by \fIcpos\fR, and the selection length (which could be 0) is given in \fIselLen\fR.
.SH "void QWSServer::sendKeyEvent ( int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat )\fC [static]\fR"
Send a key event. You can use this to send key events generated by" virtual keyboards". \fIunicode\fR is the Unicode value of the key to send, \fIkeycode\fR the Qt keycode (e.g. \fCKey_Left\fR), \fImodifiers\fR indicates whether, Shift/Alt/Ctrl keys are pressed, \fIisPress\fR is TRUE if this is a key down event and FALSE if it's a key up event, and \fIautoRepeat\fR 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).
.SH "void QWSServer::setCursorVisible ( bool vis )\fC [static]\fR"
If \fIvis\fR is TRUE, makes the cursor visible; if \fIvis\fR is FALSE, makes the cursor invisible.
.PP
See also isCursorVisible().
.SH "void QWSServer::setDefaultKeyboard ( const char * k )\fC [static]\fR"
Set the keyboard driver to \fIk\fR, e.g. if \fC$QWS_KEYBOARD\fR is not defined. The default is platform-dependent.
.SH "void QWSServer::setDefaultMouse ( const char * m )\fC [static]\fR"
Set the mouse driver \fIm\fR to use if \fC$QWS_MOUSE_PROTO\fR is not defined. The default is platform-dependent.
.SH "void QWSServer::setDesktopBackground ( const QImage & img )\fC [static]\fR"
Sets the image \fIimg\fR to be used as the background in the absence of obscuring windows.
.SH "void QWSServer::setDesktopBackground ( const QColor & c )\fC [static]\fR"
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Sets the color \fIc\fR to be used as the background in the absence of obscuring windows.
.SH "void QWSServer::setKeyboardFilter ( KeyboardFilter * f )\fC [static]\fR"
Adds a filter \fIf\fR to be invoked for all key events from physical keyboard drivers (events sent via processKeyEvent()).
.PP
The filter is not invoked for keys generated by virtual keyboard drivers (events sent via sendKeyEvent()).
.PP
If \fIf\fR is 0, the most-recently added filter is removed and deleted. The caller is responsible for matching each addition with a corresponding removal.
.SH "void QWSServer::setKeyboardHandler ( QWSKeyboardHandler * kh )\fC [static]\fR"
Sets the primary keyboard handler to \fIkh\fR.
.SH "void QWSServer::setMaxWindowRect ( const QRect & r )\fC [static]\fR"
Sets the area of the screen which Qt/Embedded applications will consider to be the maximum area to use for windows to \fIr\fR.
.PP
See also QWidget::showMaximized().
.SH "void QWSServer::setScreenSaverInterval ( int ms )\fC [static]\fR"
Sets the timeout for the screensaver to \fIms\fR milliseconds. A setting of zero turns off the screensaver.
.SH "void QWSServer::setScreenSaverIntervals ( int * ms )\fC [static]\fR"
Sets an array of timeouts for the screensaver to a list of \fIms\fR milliseconds. A setting of zero turns off the screensaver. The array must be 0-terminated.
.SH "QWSWindow * QWSServer::windowAt ( const QPoint & pos )"
Returns the window containing the point \fIpos\fR or 0 if there is no window under the point.
.SH "void QWSServer::windowEvent ( QWSWindow * w, QWSServer::WindowEvent e )\fC [signal]\fR"
This signal is emitted whenever something happens to a top-level
window (e.g. it's created or destroyed). \fIw\fR is the window to
which the event of type \fIe\fR has occurred.
.SH "SEE ALSO"
.BR http://doc.trolltech.com/qwsserver.html
.BR http://www.trolltech.com/faq/tech.html
.SH COPYRIGHT
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the
license file included in the distribution for a complete license
statement.
.SH AUTHOR
Generated automatically from the source code.
.SH BUGS
If you find a bug in Qt, please report it as described in
.BR http://doc.trolltech.com/bughowto.html .
Good bug reports help us to help you. Thank you.
.P
The definitive Qt documentation is provided in HTML format; it is
located at $QTDIR/doc/html and can be read using Qt Assistant or with
a web browser. This man page is provided as a convenience for those
users who prefer man pages, although this format is not officially
supported by Trolltech.
.P
If you find errors in this manual page, please report them to
.BR qt-bugs@trolltech.com .
Please include the name of the manual page (qwsserver.3qt) and the Qt
version (3.3.8).