Qt 4.8
Classes | Public Types | Signals | Public Functions | Static Public Functions | Static Public Variables | Protected Functions | Private Functions | Friends | List of all members
QWSServer Class Reference

The QWSServer class encapsulates a server process in Qt for Embedded Linux. More...

#include <qwindowsystem_qws.h>

Inheritance diagram for QWSServer:
QObject

Classes

class  KeyboardFilter
 The KeyboardFilter class is a base class for global keyboard event filters in Qt for Embedded Linux. More...
 

Public Types

enum  IMMouse { MousePress, MouseRelease, MouseMove, MouseOutside }
 This enum describes the various types of mouse events recognized by the QWSInputMethod::mouseHandler() function. More...
 
enum  ServerFlags { DisableKeyboard = 0x01, DisableMouse = 0x02 }
 This enum is used to pass various options to the window system server. More...
 
enum  WindowEvent {
  Create =0x0001, Destroy =0x0002, Hide =0x0004, Show =0x0008,
  Raise =0x0010, Lower =0x0020, Geometry =0x0040, Active = 0x0080,
  Name =0x0100
}
 This enum specifies the various events that can occur in a top-level window. More...
 

Signals

void markedText (const QString &)
 This signal is emitted whenever some text is selected in any of the running applications, passing the selected text in the selection parameter. More...
 
void newChannel (const QString &channel)
 This signal is emitted whenever a new QCopChannel object is created, passing the channel's name in the channel parameter. More...
 
void removedChannel (const QString &channel)
 This signal is emitted immediately after the given the QCopChannel object specified by channel, is destroyed. More...
 
void windowEvent (QWSWindow *w, QWSServer::WindowEvent e)
 This signal is emitted whenever something happens to a top-level window (e.g., it's created or destroyed), passing a pointer to the window and the event's type in the window and eventType parameters, respectively. More...
 
- Signals inherited from QObject
void destroyed (QObject *=0)
 This signal is emitted immediately before the object obj is destroyed, and can not be blocked. More...
 

Public Functions

const QBrushbackgroundBrush () const
 Returns the brush used as background in the absence of obscuring windows. More...
 
const QList< QWSWindow * > & clientWindows ()
 Returns the list of current top-level windows. More...
 
void closeKeyboard ()
 Closes all the keyboard devices (specified by the QWS_KEYBOARD environment variable) by deleting the associated keyboard drivers. More...
 
void closeMouse ()
 Closes all pointer devices (specified by the QWS_MOUSE_PROTO environment variable) by deleting the associated mouse drivers. More...
 
void enablePainting (bool)
 Enables painting onto the screen if enable is true; otherwise painting is disabled. More...
 
void openKeyboard ()
 Opens the keyboard devices specified by the QWS_KEYBOARD environment variable. More...
 
void openMouse ()
 Opens the mouse devices specified by the QWS_MOUSE_PROTO environment variable. More...
 
 QWSServer (int flags=0, QObject *parent=0)
 
void refresh ()
 Refreshes the display by making the screen driver update the entire display. More...
 
void refresh (QRegion &)
 Refreshes the given region of the display. More...
 
void resumeMouse ()
 Resumes pointer handling by reactivating all the mouse drivers registered by the QWS_MOUSE_PROTO environment variable. More...
 
void sendIMEvent (const QInputMethodEvent *)
 Sends the given input method event. More...
 
void sendIMQuery (int property)
 Sends an input method query for the given property. More...
 
void sendPropertyNotifyEvent (int property, int state)
 
void suspendMouse ()
 Suspends pointer handling by deactivating all the mouse drivers registered by the QWS_MOUSE_PROTO environment variable. More...
 
QWSWindowwindowAt (const QPoint &pos)
 Returns the window containing the given position. More...
 
 ~QWSServer ()
 Destructs this server. More...
 
- Public Functions inherited from QObject
bool blockSignals (bool b)
 If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke anything connected to it). More...
 
const QObjectListchildren () const
 Returns a list of child objects. More...
 
bool connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const
 
bool disconnect (const char *signal=0, const QObject *receiver=0, const char *member=0)
 
bool disconnect (const QObject *receiver, const char *member=0)
 
void dumpObjectInfo ()
 Dumps information about signal connections, etc. More...
 
void dumpObjectTree ()
 Dumps a tree of children to the debug output. More...
 
QList< QByteArraydynamicPropertyNames () const
 Returns the names of all properties that were dynamically added to the object using setProperty(). More...
 
virtual bool event (QEvent *)
 This virtual function receives events to an object and should return true if the event e was recognized and processed. More...
 
virtual bool eventFilter (QObject *, QEvent *)
 Filters events if this object has been installed as an event filter for the watched object. More...
 
template<typename T >
findChild (const QString &aName=QString()) const
 Returns the child of this object that can be cast into type T and that is called name, or 0 if there is no such object. More...
 
template<typename T >
QList< T > findChildren (const QString &aName=QString()) const
 Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects. More...
 
template<typename T >
QList< T > findChildren (const QRegExp &re) const
 
bool inherits (const char *classname) const
 Returns true if this object is an instance of a class that inherits className or a QObject subclass that inherits className; otherwise returns false. More...
 
void installEventFilter (QObject *)
 Installs an event filter filterObj on this object. More...
 
bool isWidgetType () const
 Returns true if the object is a widget; otherwise returns false. More...
 
void killTimer (int id)
 Kills the timer with timer identifier, id. More...
 
virtual const QMetaObjectmetaObject () const
 Returns a pointer to the meta-object of this object. More...
 
void moveToThread (QThread *thread)
 Changes the thread affinity for this object and its children. More...
 
QString objectName () const
 
QObjectparent () const
 Returns a pointer to the parent object. More...
 
QVariant property (const char *name) const
 Returns the value of the object's name property. More...
 
Q_INVOKABLE QObject (QObject *parent=0)
 Constructs an object with parent object parent. More...
 
void removeEventFilter (QObject *)
 Removes an event filter object obj from this object. More...
 
void setObjectName (const QString &name)
 
void setParent (QObject *)
 Makes the object a child of parent. More...
 
bool setProperty (const char *name, const QVariant &value)
 Sets the value of the object's name property to value. More...
 
void setUserData (uint id, QObjectUserData *data)
 
bool signalsBlocked () const
 Returns true if signals are blocked; otherwise returns false. More...
 
int startTimer (int interval)
 Starts a timer and returns a timer identifier, or returns zero if it could not start a timer. More...
 
QThreadthread () const
 Returns the thread in which the object lives. More...
 
QObjectUserDatauserData (uint id) const
 
virtual ~QObject ()
 Destroys the object, deleting all its child objects. More...
 

Static Public Functions

static void addKeyboardFilter (KeyboardFilter *f)
 Activates the given keyboard filter all key events generated by physical keyboard drivers (i.e., events sent using the processKeyEvent() function). More...
 
static void beginDisplayReconfigure ()
 
static void closedown ()
 
static void endDisplayReconfigure ()
 
static QWSServerinstance ()
 
static bool isCursorVisible ()
 Returns true if the cursor is visible; otherwise returns false. More...
 
static QWSKeyboardHandlerkeyboardHandler ()
 Returns the primary keyboard driver. More...
 
static QWSMouseHandlermouseHandler ()
 Returns the primary mouse driver. More...
 
static const QList< QWSMouseHandler * > & mouseHandlers ()
 Returns list of all mouse handlers. More...
 
static void processEventQueue ()
 
static void processKeyEvent (int unicode, int keycode, Qt::KeyboardModifiers modifiers, bool isPress, bool autoRepeat)
 Processes the given key event. More...
 
static void removeKeyboardFilter ()
 Removes and deletes the most recently added filter. More...
 
static void resetInputMethod ()
 
static void screenSaverActivate (bool)
 Activates the screen saver if activate is true; otherwise it is deactivated. More...
 
static bool screenSaverActive ()
 Returns true if the screen saver is active; otherwise returns false. More...
 
static void sendKeyEvent (int unicode, int keycode, Qt::KeyboardModifiers modifiers, bool isPress, bool autoRepeat)
 Sends the given key event. More...
 
static void sendMouseEvent (const QPoint &pos, int state, int wheel=0)
 Send a mouse event. More...
 
static void setBackground (const QBrush &)
 Sets the brush used as background in the absence of obscuring windows, to be the given brush. More...
 
static void setCurrentInputMethod (QWSInputMethod *im)
 Sets the current input method to be the given method. More...
 
static void setCursorVisible (bool)
 Shows the cursor if visible is true: otherwise the cursor is hidden. More...
 
static void setDefaultKeyboard (const char *)
 Sets the keyboard driver that will be used if the QWS_KEYBOARD environment variable is not defined, to be the given keyboardDriver. More...
 
static void setDefaultMouse (const char *)
 Sets the mouse driver that will be used if the QWS_MOUSE_PROTO environment variable is not defined, to be the given mouseDriver. More...
 
static void setKeyboardHandler (QWSKeyboardHandler *kh)
 Sets the primary keyboard driver to be the given driver. More...
 
static void setMaxWindowRect (const QRect &)
 Sets the maximum area of the screen that Qt for Embedded Linux applications can use, to be the given rectangle. More...
 
static void setMouseHandler (QWSMouseHandler *)
 Sets the primary mouse driver to be the given driver. More...
 
static void setScreenSaver (QWSScreenSaver *)
 Installs the given screenSaver, deleting the current screen saver. More...
 
static void setScreenSaverBlockLevel (int)
 Block the key or mouse event that wakes the system from level eventBlockLevel or higher. More...
 
static void setScreenSaverInterval (int)
 Sets the timeout interval for the screensaver to the specified milliseconds. More...
 
static void setScreenSaverIntervals (int *ms)
 Specifies the time intervals (in milliseconds) between the different levels of screen responsiveness. More...
 
static void startup (int flags)
 
static QList< QWSInternalWindowInfo * > * windowList ()
 
- Static Public Functions inherited from QObject
static bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
 Creates a connection of the given type from the signal in the sender object to the method in the receiver object. More...
 
static bool connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type=Qt::AutoConnection)
 
static bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member)
 Disconnects signal in object sender from method in object receiver. More...
 
static bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &member)
 
static uint registerUserData ()
 
static QString tr (const char *sourceText, const char *comment=0, int n=-1)
 
static QString trUtf8 (const char *sourceText, const char *comment=0, int n=-1)
 

Static Public Variables

static QPoint mousePosition
 
- Static Public Variables inherited from QObject
static const QMetaObject staticMetaObject
 This variable stores the meta-object for the class. More...
 

Protected Functions

void timerEvent (QTimerEvent *e)
 
- Protected Functions inherited from QObject
virtual void childEvent (QChildEvent *)
 This event handler can be reimplemented in a subclass to receive child events. More...
 
virtual void connectNotify (const char *signal)
 This virtual function is called when something has been connected to signal in this object. More...
 
virtual void customEvent (QEvent *)
 This event handler can be reimplemented in a subclass to receive custom events. More...
 
virtual void disconnectNotify (const char *signal)
 This virtual function is called when something has been disconnected from signal in this object. More...
 
 QObject (QObjectPrivate &dd, QObject *parent=0)
 
int receivers (const char *signal) const
 Returns the number of receivers connected to the signal. More...
 
QObjectsender () const
 Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; otherwise it returns 0. More...
 
int senderSignalIndex () const
 

Private Functions

void updateWindowRegions () const
 

Friends

class QApplicationPrivate
 
class QCopChannel
 
class QWSDisplay
 
class QWSInputMethod
 
class QWSMouseHandler
 
class QWSWindow
 

Additional Inherited Members

- Public Slots inherited from QObject
void deleteLater ()
 Schedules this object for deletion. More...
 
- Protected Variables inherited from QObject
QScopedPointer< QObjectDatad_ptr
 
- Static Protected Variables inherited from QObject
static const QMetaObject staticQtMetaObject
 

Detailed Description

The QWSServer class encapsulates a server process in Qt for Embedded Linux.

When you run a Qt for Embedded Linux application, it either runs as a server or connects to an existing server. The server and client processes have different responsibilities: The client process performs all application specific operations. The server process is responsible for managing the clients as well as taking care of the pointer handling, character input, and screen output. In addition, the server provides functionality to handle input methods.

In Qt for Embedded Linux, all system generated events are passed to the server application which then propagates the event to the appropriate client. See the Qt for Embedded Linux Architecture documentation for details.

Note that this class is instantiated by QApplication for Qt for Embedded Linux server processes; you should never construct this class yourself. Use the instance() function to retrieve a pointer to the server object.

Note that the static functions of the QWSServer class can only be used in the server process.

Client Administration

As applications add and remove windows, the server process maintains information about each window. In Qt for Embedded Linux, top-level windows are encapsulated as QWSWindow objects. Each window can tell which client that owns it through its QWSWindow::client() function. Use the clientWindows() function to retrieve a list of the current top-level windows. Given a particular position on the display, the window containing it can be retrieved using the windowAt() function.

QWSServer also provides the windowEvent() signal which is emitted whenever something happens to a top level window; the WindowEvent enum describes the various types of events that the signal recognizes. In addition, the server class provides the markedText() signal which is emitted whenever some text has been selected in any of the windows, passing the selection as parameter.

The QCopChannel class and the QCOP communication protocol enable transfer of messages between clients. QWSServer provides the newChannel() and removedChannel() signals that is emitted whenever a new QCopChannel object is created or destroyed, respectively.

See also: QWSWindow, QWSClient and QCopChannel.

Mouse Handling

The mouse driver (represented by an instance of the QWSMouseHandler class) is loaded by the server application when it starts running, using Qt's How to Create Qt Plugins. A mouse driver receives mouse events from the device and encapsulates each event with an instance of the QWSEvent class which it then passes to the server.

The openMouse() function opens the mouse devices specified by the QWS_MOUSE_PROTO environment variable, and the setMouseHandler() functions sets the primary mouse driver. Alternatively, the static setDefaultMouse() function provides means of specifying the mouse driver to use if the QWS_MOUSE_PROTO variable is not defined (note that the default is otherwise platform dependent). The primary mouse driver can be retrieved using the static mouseHandler() function. Use the closeMouse() function to delete the mouse drivers.

In addition, the QWSServer class can control the flow of mouse input using the suspendMouse() and resumeMouse() functions.

See also: QWSMouseHandler and Qt for Embedded Linux Pointer Handling.

Keyboard Handling

The keyboard driver (represented by an instance of the QWSKeyboardHandler class) is loaded by the server application when it starts running, using Qt's How to Create Qt Plugins. A keyboard driver receives keyboard events from the device and encapsulates each event with an instance of the QWSEvent class which it then passes to the server.

The openKeyboard() function opens the keyboard devices specified by the QWS_KEYBOARD environment variable, and the setKeyboardHandler() functions sets the primary keyboard driver. Alternatively, the static setDefaultKeyboard() function provides means of specifying the keyboard driver to use if the QWS_KEYBOARD variable is not defined (note again that the default is otherwise platform dependent). The primary keyboard driver can be retrieved using the static keyboardHandler() function. Use the closeKeyboard() function to delete the keyboard drivers.

In addition, the QWSServer class can handle key events from both physical and virtual keyboards using the processKeyEvent() and sendKeyEvent() functions, respectively. Use the addKeyboardFilter() function to filter the key events from physical keyboard drivers, the most recently added filter can be removed and deleted using the removeKeyboardFilter() function.

See also: QWSKeyboardHandler and Qt for Embedded Linux Character Input.

Display Handling

When a screen update is required, the server runs through all the top-level windows that intersect with the region that is about to be updated, and ensures that the associated clients have updated their memory buffer. Then the server uses the screen driver (represented by an instance of the QScreen class) to copy the content of the memory to the screen.

In addition, the QWSServer class provides some means of managing the screen output: Use the refresh() function to refresh the entire display, or alternatively a specified region of it. The enablePainting() function can be used to disable (and enable) painting onto the screen. QWSServer also provide the setMaxWindowRect() function restricting the area of the screen which Qt for Embedded Linux applications will consider to be the maximum area to use for windows. To set the brush used as the background in the absence of obscuring windows, QWSServer provides the static setBackground() function. The corresponding backgroundBrush() function returns the currently set brush.

QWSServer also controls the screen saver: Use the setScreenSaver() to install a custom screen saver derived from the QWSScreenSaver class. Once installed, the screensaver can be activated using the screenSaverActivate() function, and the screenSaverActive() function returns its current status. Use the setScreenSaverInterval() function to specify the timeout interval. Qt for Embedded Linux also supports multilevel screen saving, use the setScreenSaverIntervals() function to specify the various levels and their timeout intervals.

Finally, the QWSServer class controls the cursor's appearance, i.e., use the setCursorVisible() function to hide or show the cursor, and the isCursorVisible() function to determine whether the cursor is visible on the display or not.

See also: QScreen and Qt for Embedded Linux Display Management.

Input Method Handling

Whenever the server receives an event, it queries its stack of top-level windows to find the window containing the event's position (each window can identify the client application that created it). Then the server forwards the event to the appropriate client. If an input method is installed, it is used as a filter between the server and the client application.

Derive from the QWSInputMethod class to create custom input methods, and use the server's setCurrentInputMethod() function to install it. Use the sendIMEvent() and sendIMQuery() functions to send input method events and queries.

QWSServer provides the IMMouse enum describing the various mouse events recognized by the QWSInputMethod::mouseHandler() function. The latter function allows subclasses of QWSInputMethod to handle mouse events within the preedit text.

See also
QWSInputMethod

Definition at line 209 of file qwindowsystem_qws.h.

Enumerations

◆ IMMouse

This enum describes the various types of mouse events recognized by the QWSInputMethod::mouseHandler() function.

  • MousePress An event generated by pressing a mouse button.
  • MouseRelease An event generated by relasing a mouse button.
  • MouseMove An event generated by moving the mouse cursor.
  • MouseOutside This value is only reserved, i.e., it is not used in current implementations.
See also
QWSInputMethod, setCurrentInputMethod()
Enumerator
MousePress 
MouseRelease 
MouseMove 
MouseOutside 

Definition at line 240 of file qwindowsystem_qws.h.

◆ ServerFlags

This enum is used to pass various options to the window system server.

Warning
This function is not part of the public interface.
  • DisableKeyboard Ignore all keyboard input.
  • DisableMouse Ignore all mouse input.
Enumerator
DisableKeyboard 
DisableMouse 

Definition at line 224 of file qwindowsystem_qws.h.

◆ WindowEvent

This enum specifies the various events that can occur in a top-level window.

  • Create A new window has been created (by the QWidget constructor).
  • Destroy The window has been closed and deleted (by the QWidget destructor).
  • Hide The window has been hidden using the QWidget::hide() function.
  • Show The window has been shown using the QWidget::show() function or similar.
  • Raise The window has been raised to the top of the desktop.
  • Lower The window has been lowered.
  • Geometry The window has changed size or position.
  • Active The window has become the active window (i.e., it has keyboard focus).
  • Name The window has been named.
See also
windowEvent()
Enumerator
Create 
Destroy 
Hide 
Show 
Raise 
Lower 
Geometry 
Active 
Name 

Definition at line 324 of file qwindowsystem_qws.h.

Constructors and Destructors

◆ QWSServer()

QWSServer::QWSServer ( int  flags = 0,
QObject parent = 0 
)
explicit
Warning
This function is not part of the public interface.

Construct a QWSServer object with the given parent. The flags are used for keyboard and mouse settings.

Warning
This class is instantiated by QApplication for Qt for Embedded Linux server processes. You should never construct this class yourself.
See also
{Running Applications}

Definition at line 1399 of file qwindowsystem_qws.cpp.

1399  :
1400  QObject(*new QWSServerPrivate, parent)
1401 {
1402  Q_D(QWSServer);
1403  QT_TRY {
1404  d->initServer(flags);
1405  } QT_CATCH(...) {
1406  qwsServer = 0;
1407  qwsServerPrivate = 0;
1408  QT_RETHROW;
1409  }
1410 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
#define QT_RETHROW
Definition: qglobal.h:1539
#define QT_CATCH(A)
Definition: qglobal.h:1537
static QWSServerPrivate * qwsServerPrivate
The QWSServer class encapsulates a server process in Qt for Embedded Linux.
Q_INVOKABLE QObject(QObject *parent=0)
Constructs an object with parent object parent.
Definition: qobject.cpp:753
#define QT_TRY
Definition: qglobal.h:1536
QWSServer Q_GUI_EXPORT * qwsServer

◆ ~QWSServer()

QWSServer::~QWSServer ( )

Destructs this server.

Warning
This function is not part of the public interface.

Definition at line 1563 of file qwindowsystem_qws.cpp.

1564 {
1565  closeMouse();
1566 #ifndef QT_NO_QWS_KEYBOARD
1567  closeKeyboard();
1568 #endif
1569  d_func()->cleanupFonts(/*force =*/true);
1570 }
void closeMouse()
Closes all pointer devices (specified by the QWS_MOUSE_PROTO environment variable) by deleting the as...
void closeKeyboard()
Closes all the keyboard devices (specified by the QWS_KEYBOARD environment variable) by deleting the ...

Functions

◆ addKeyboardFilter()

void QWSServer::addKeyboardFilter ( KeyboardFilter filter)
static

Activates the given keyboard filter all key events generated by physical keyboard drivers (i.e., events sent using the processKeyEvent() function).

Note that the filter is not invoked for keys generated by virtual keyboard drivers (i.e., events sent using the sendKeyEvent() function).

Note that this function can only be used in the server process.

See also
removeKeyboardFilter()

Definition at line 4294 of file qwindowsystem_qws.cpp.

4295 {
4296  if (!keyFilters)
4298  if (f) {
4299  keyFilters->prepend(f);
4300  }
4301 }
static QList< QWSServer::KeyboardFilter * > * keyFilters
The QList class is a template class that provides lists.
Definition: qdatastream.h:62

◆ backgroundBrush()

const QBrush & QWSServer::backgroundBrush ( ) const

Returns the brush used as background in the absence of obscuring windows.

See also
setBackground()

Definition at line 4113 of file qwindowsystem_qws.cpp.

Referenced by QScreen::compose(), and QScreen::paintBackground().

4114 {
4115  return *QWSServerPrivate::bgBrush;
4116 }
static QBrush * bgBrush

◆ beginDisplayReconfigure()

void QWSServer::beginDisplayReconfigure ( )
static
Warning
This function is not part of the public interface.

Definition at line 2700 of file qwindowsystem_qws.cpp.

2701 {
2702  qwsServer->enablePainting(false);
2703 #ifndef QT_NO_QWS_CURSOR
2704  if (qt_screencursor)
2705  qt_screencursor->hide();
2706 #endif
2707  QWSDisplay::grab(true);
2708  qt_screen->disconnect();
2709 }
Q_GUI_EXPORT QScreen * qt_screen
Definition: qscreen_qws.cpp:69
virtual void disconnect()=0
This function is called by every Qt for Embedded Linux application before exiting, and must be implemented to unmap the framebuffer.
void enablePainting(bool)
Enables painting onto the screen if enable is true; otherwise painting is disabled.
static void grab()
virtual void hide()
Hides the cursor from the screen.
Q_GUI_EXPORT QScreenCursor * qt_screencursor
Definition: qscreen_qws.cpp:67
QWSServer Q_GUI_EXPORT * qwsServer

◆ clientWindows()

const QList< QWSWindow * > & QWSServer::clientWindows ( )

Returns the list of current top-level windows.

Note that the collection of top-level windows changes as applications add and remove widgets so it should not be stored for future use. The windows are sorted in stacking order from top-most to bottom-most.

Use the QWSWindow::client() function to retrieve the client application that owns a given window.

See also
windowAt(), instance()

Definition at line 1586 of file qwindowsystem_qws.cpp.

Referenced by QScreen::compose(), QDirectFBScreen::exposeRegion(), QScreen::exposeRegion(), and QWSTtyKbPrivate::handleConsoleSwitch().

1587 {
1588  Q_D(QWSServer);
1589  return d->windows;
1590 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
The QWSServer class encapsulates a server process in Qt for Embedded Linux.

◆ closedown()

void QWSServer::closedown ( )
static
Warning
This function is not part of the public interface.

Definition at line 4207 of file qwindowsystem_qws.cpp.

Referenced by qt_cleanup(), and QWSServerCleaner::~QWSServerCleaner().

4208 {
4210  qwsServer = 0;
4211  QT_TRY {
4212  unlink(qws_qtePipeFilename().toLatin1().constData());
4213  } QT_CATCH(const std::bad_alloc &) {
4214  // ### TODO - what to do when we run out of memory
4215  // when calling toLatin1?
4216  }
4217 }
The QScopedPointer class stores a pointer to a dynamically allocated object, and deletes it upon dest...
QString qws_qtePipeFilename()
#define QT_CATCH(A)
Definition: qglobal.h:1537
static QAuServer & server()
Definition: qsound.cpp:79
#define QT_TRY
Definition: qglobal.h:1536
QWSServer Q_GUI_EXPORT * qwsServer

◆ closeKeyboard()

void QWSServer::closeKeyboard ( )

Closes all the keyboard devices (specified by the QWS_KEYBOARD environment variable) by deleting the associated keyboard drivers.

See also
openKeyboard(), keyboardHandler()

Definition at line 3841 of file qwindowsystem_qws.cpp.

Referenced by QWSServerPrivate::emergency_cleanup(), openKeyboard(), and ~QWSServer().

3842 {
3843  Q_D(QWSServer);
3844  qDeleteAll(d->keyboardhandlers);
3845  d->keyboardhandlers.clear();
3846 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
The QWSServer class encapsulates a server process in Qt for Embedded Linux.
Q_OUTOFLINE_TEMPLATE void qDeleteAll(ForwardIterator begin, ForwardIterator end)
Definition: qalgorithms.h:319

◆ closeMouse()

void QWSServer::closeMouse ( )

Closes all pointer devices (specified by the QWS_MOUSE_PROTO environment variable) by deleting the associated mouse drivers.

See also
openMouse(), mouseHandler()

Definition at line 3725 of file qwindowsystem_qws.cpp.

Referenced by openMouse(), and ~QWSServer().

3726 {
3727  Q_D(QWSServer);
3728  qDeleteAll(d->mousehandlers);
3729  d->mousehandlers.clear();
3730 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
The QWSServer class encapsulates a server process in Qt for Embedded Linux.
Q_OUTOFLINE_TEMPLATE void qDeleteAll(ForwardIterator begin, ForwardIterator end)
Definition: qalgorithms.h:319

◆ enablePainting()

void QWSServer::enablePainting ( bool  enable)

Enables painting onto the screen if enable is true; otherwise painting is disabled.

See also
{Qt for Embedded Linux Architecture::Drawing on Screen}{Qt for Embedded Linux Architecture}

Definition at line 2169 of file qwindowsystem_qws.cpp.

Referenced by beginDisplayReconfigure(), QVNCServer::discardClient(), endDisplayReconfigure(), QWSTtyKbPrivate::handleConsoleSwitch(), QVNCScreen::initDevice(), and QVNCServer::newConnection().

2170 {
2171  Q_D(QWSServer);
2172 
2173  if (d->disablePainting == !enable)
2174  return;
2175 
2176  d->disablePainting = !enable;
2177 
2178  if (enable) {
2179  // Reset the server side allocated regions to ensure update_regions()
2180  // will send out region events.
2181  for (int i = 0; i < d->windows.size(); ++i) {
2182  QWSWindow *w = d->windows.at(i);
2184 #ifdef QT_QWS_CLIENTBLIT
2185  w->setDirectPaintRegion(QRegion());
2186 #endif
2187  }
2188  d->update_regions();
2189  d->showCursor();
2190  } else {
2191  // Disable painting by clients by taking away their allocated region.
2192  // To ensure mouse events are still delivered to the correct windows,
2193  // the allocated regions are not modified on the server.
2194  for (int i = 0; i < d->windows.size(); ++i) {
2195  QWSWindow *w = d->windows.at(i);
2196  w->client()->sendRegionEvent(w->winId(), QRegion(),
2198 #ifdef QT_QWS_CLIENTBLIT
2199  w->client()->sendRegionEvent(w->winId(), QRegion(),
2200  QWSRegionEvent::DirectPaint);
2201 #endif
2202  }
2203  d->hideCursor();
2204  }
2205 }
void setAllocatedRegion(const QRegion &region)
double d
Definition: qnumeric_p.h:62
QWSClient * client() const
Returns a reference to the QWSClient object that owns this window.
#define Q_D(Class)
Definition: qglobal.h:2482
The QWSWindow class encapsulates a top-level window in Qt for Embedded Linux.
The QRegion class specifies a clip region for a painter.
Definition: qregion.h:68
void sendRegionEvent(int winid, QRegion rgn, int type)
int winId() const
Returns the window&#39;s ID.
The QWSServer class encapsulates a server process in Qt for Embedded Linux.

◆ endDisplayReconfigure()

void QWSServer::endDisplayReconfigure ( )
static
Warning
This function is not part of the public interface.

Definition at line 2714 of file qwindowsystem_qws.cpp.

2715 {
2719 
2721 #ifndef QT_NO_QWS_CURSOR
2722  if (qt_screencursor)
2723  qt_screencursor->show();
2724 #endif
2726  ap->setMaxWindowRect(qt_screen, 0,
2727  QRect(0, 0, qt_screen->width(), qt_screen->height()));
2728  QSize olds = qApp->desktop()->size();
2729  qApp->desktop()->resize(qt_screen->width(), qt_screen->height());
2730  qApp->postEvent(qApp->desktop(), new QResizeEvent(qApp->desktop()->size(), olds));
2731  qwsServer->enablePainting(true);
2732  qwsServer->refresh();
2733  qDebug("Desktop size: %dx%d", qApp->desktop()->width(), qApp->desktop()->height());
2734 }
Q_GUI_EXPORT QScreen * qt_screen
Definition: qscreen_qws.cpp:69
void setMaxWindowRect(const QScreen *screen, int screenNo, const QRect &rect)
int height() const
Returns the logical height of the framebuffer in pixels.
Definition: qscreen_qws.h:228
void refresh()
Refreshes the display by making the screen driver update the entire display.
virtual bool connect(const QString &displaySpec)=0
This function is called by every Qt for Embedded Linux application on startup, and must be implemente...
static QApplicationPrivate * instance()
int deviceWidth() const
Returns the physical width of the framebuffer device in pixels.
Definition: qscreen_qws.h:233
The QString class provides a Unicode character string.
Definition: qstring.h:83
Q_CORE_EXPORT void qDebug(const char *,...)
int width() const
Returns the logical width of the framebuffer in pixels.
Definition: qscreen_qws.h:227
void enablePainting(bool)
Enables painting onto the screen if enable is true; otherwise painting is disabled.
#define qApp
The QResizeEvent class contains event parameters for resize events.
Definition: qevent.h:349
static QWSServerPrivate * qwsServerPrivate
int deviceHeight() const
Returns the full height of the framebuffer device in pixels.
Definition: qscreen_qws.h:234
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53
Q_GUI_EXPORT QScreenCursor * qt_screencursor
Definition: qscreen_qws.cpp:67
static void ungrab()
virtual void show()
Shows the mouse cursor.
QWSServer Q_GUI_EXPORT * qwsServer

◆ instance()

static QWSServer * QWSServer::instance ( )
inlinestatic
Since
4.2

Returns a pointer to the server instance.

Note that the pointer will be 0 if the application is not the server, i.e., if the QApplication::type() function doesn't return QApplication::GuiServer.

See also
clientWindows(), windowAt()

Definition at line 234 of file qwindowsystem_qws.h.

Referenced by QVNCServer::discardClient(), QDirectFBScreen::exposeRegion(), QWSTtyKbPrivate::handleConsoleSwitch(), QVNCScreen::initDevice(), QDirectFBScreen::initDevice(), QFontDatabasePrivate::loadFromCache(), QVNCServer::newConnection(), QDirectFBScreenPrivate::QDirectFBScreenPrivate(), and QApplicationPrivate::setScreenTransformation().

234 { return qwsServer; }
Q_GUI_EXPORT QWSServer * qwsServer

◆ isCursorVisible()

bool QWSServer::isCursorVisible ( )
static

Returns true if the cursor is visible; otherwise returns false.

Note that this function can only be used in the server process.

See also
setCursorVisible()

Definition at line 2778 of file qwindowsystem_qws.cpp.

2779 {
2781 }
static QWSServerPrivate * qwsServerPrivate

◆ keyboardHandler()

QWSKeyboardHandler * QWSServer::keyboardHandler ( )
static

Returns the primary keyboard driver.

Note that this function can only be used in the server process.

See also
setKeyboardHandler(), openKeyboard(), closeKeyboard()

Definition at line 3855 of file qwindowsystem_qws.cpp.

3856 {
3858 }
static QWSServerPrivate * qwsServerPrivate
QList< QWSKeyboardHandler * > keyboardhandlers
T & first()
Returns a reference to the first item in the list.
Definition: qlist.h:282

◆ markedText

void QWSServer::markedText ( const QString selection)
signal

This signal is emitted whenever some text is selected in any of the running applications, passing the selected text in the selection parameter.

See also
windowEvent()

◆ mouseHandler()

QWSMouseHandler * QWSServer::mouseHandler ( )
static

Returns the primary mouse driver.

Note that this function can only be used in the server process.

See also
setMouseHandler(), openMouse(), closeMouse()

Definition at line 2494 of file qwindowsystem_qws.cpp.

2495 {
2497  return 0;
2499 }
bool empty() const
This function is provided for STL compatibility.
Definition: qlist.h:304
QList< QWSMouseHandler * > mousehandlers
static QWSServerPrivate * qwsServerPrivate
T & first()
Returns a reference to the first item in the list.
Definition: qlist.h:282

◆ mouseHandlers()

const QList< QWSMouseHandler * > & QWSServer::mouseHandlers ( )
static

Returns list of all mouse handlers.

Note that this function can only be used in the server process.

Since
4.5
See also
mouseHandler(), setMouseHandler(), openMouse(), closeMouse()

Definition at line 2513 of file qwindowsystem_qws.cpp.

2514 {
2516 }
QList< QWSMouseHandler * > mousehandlers
static QWSServerPrivate * qwsServerPrivate

◆ newChannel

void QWSServer::newChannel ( const QString channel)
signal

This signal is emitted whenever a new QCopChannel object is created, passing the channel's name in the channel parameter.

See also
removedChannel()

◆ openKeyboard()

void QWSServer::openKeyboard ( )

Opens the keyboard devices specified by the QWS_KEYBOARD environment variable.

See also
closeKeyboard(), keyboardHandler()

Definition at line 3888 of file qwindowsystem_qws.cpp.

3889 {
3890  QString keyboards = QString::fromLatin1(qgetenv("QWS_KEYBOARD"));
3891 #if defined(QT_QWS_CASSIOPEIA)
3892  if (keyboards.isEmpty())
3893  keyboards = QLatin1String("Buttons");
3894 #endif
3895  if (keyboards.isEmpty())
3896  keyboards = *defaultKeyboard();
3897 
3898  closeKeyboard();
3899  if (keyboards == QLatin1String("None"))
3900  return;
3901 
3902  QString device;
3903  QString type;
3904  QStringList keyboard = keyboards.split(QLatin1Char(' '));
3905  for (int i = keyboard.size() - 1; i >= 0; --i) {
3906  const QString spec = keyboard.at(i);
3907  int colon=spec.indexOf(QLatin1Char(':'));
3908  if (colon>=0) {
3909  type = spec.left(colon);
3910  device = spec.mid(colon+1);
3911  } else {
3912  type = spec;
3913  device = QString();
3914  }
3916  setKeyboardHandler(handler);
3917  }
3918 }
The QWSKeyboardHandler class is a base class for keyboard drivers in Qt for Embedded Linux...
Definition: qkbd_qws.h:57
Q_CORE_EXPORT QByteArray qgetenv(const char *varName)
int type
Definition: qmetatype.cpp:239
The QString class provides a Unicode character string.
Definition: qstring.h:83
void closeKeyboard()
Closes all the keyboard devices (specified by the QWS_KEYBOARD environment variable) by deleting the ...
defaultKeyboard
QLatin1String("TTY"))) static const int FontCleanupInterval
QString left(int n) const Q_REQUIRED_RESULT
Returns a substring that contains the n leftmost characters of the string.
Definition: qstring.cpp:3664
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
Definition: qstring.h:704
static QWSKeyboardHandler * create(const QString &, const QString &)
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
The QStringList class provides a list of strings.
Definition: qstringlist.h:66
int indexOf(QChar c, int from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Definition: qstring.cpp:2838
QString mid(int position, int n=-1) const Q_REQUIRED_RESULT
Returns a string that contains n characters of this string, starting at the specified position index...
Definition: qstring.cpp:3706
static void setKeyboardHandler(QWSKeyboardHandler *kh)
Sets the primary keyboard driver to be the given driver.
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
Definition: qstring.cpp:4188
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
QStringList split(const QString &sep, SplitBehavior behavior=KeepEmptyParts, Qt::CaseSensitivity cs=Qt::CaseSensitive) const Q_REQUIRED_RESULT
Splits the string into substrings wherever sep occurs, and returns the list of those strings...
Definition: qstring.cpp:6526
QImageIOHandler * handler
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
Definition: qchar.h:55

◆ openMouse()

void QWSServer::openMouse ( )

Opens the mouse devices specified by the QWS_MOUSE_PROTO environment variable.

Be advised that closeMouse() is called first to delete all the existing mouse handlers. This behaviour could be the cause of problems if you were not expecting it.

See also
closeMouse(), mouseHandler()

Definition at line 3740 of file qwindowsystem_qws.cpp.

3741 {
3742  Q_D(QWSServer);
3743  QString mice = QString::fromLatin1(qgetenv("QWS_MOUSE_PROTO"));
3744 #if defined(QT_QWS_CASSIOPEIA)
3745  if (mice.isEmpty())
3746  mice = QLatin1String("TPanel:/dev/tpanel");
3747 #endif
3748  if (mice.isEmpty())
3749  mice = *defaultMouse();
3750  closeMouse();
3751  bool needviscurs = true;
3752  if (mice != QLatin1String("None")) {
3753  const QStringList mouse = mice.split(QLatin1Char(' '));
3754  for (int i = mouse.size() - 1; i >= 0; --i) {
3755  QWSMouseHandler *handler = d->newMouseHandler(mouse.at(i));
3756  setMouseHandler(handler);
3757  /* XXX handle mouse cursor visibility sensibly
3758  if (!h->inherits("QCalibratedMouseHandler"))
3759  needviscurs = true;
3760  */
3761  }
3762  }
3763 #ifndef QT_NO_QWS_CURSOR
3764  setCursorVisible(needviscurs);
3765 #else
3766  Q_UNUSED(needviscurs)
3767 #endif
3768 }
double d
Definition: qnumeric_p.h:62
Q_CORE_EXPORT QByteArray qgetenv(const char *varName)
The QWSMouseHandler class is a base class for mouse drivers in Qt for Embedded Linux.
Definition: qmouse_qws.h:66
static void setCursorVisible(bool)
Shows the cursor if visible is true: otherwise the cursor is hidden.
The QString class provides a Unicode character string.
Definition: qstring.h:83
#define Q_D(Class)
Definition: qglobal.h:2482
void closeMouse()
Closes all pointer devices (specified by the QWS_MOUSE_PROTO environment variable) by deleting the as...
QLatin1String("TTY"))) static const int FontCleanupInterval
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
Definition: qstring.h:704
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
The QStringList class provides a list of strings.
Definition: qstringlist.h:66
The QWSServer class encapsulates a server process in Qt for Embedded Linux.
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
Definition: qstring.cpp:4188
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
QStringList split(const QString &sep, SplitBehavior behavior=KeepEmptyParts, Qt::CaseSensitivity cs=Qt::CaseSensitive) const Q_REQUIRED_RESULT
Splits the string into substrings wherever sep occurs, and returns the list of those strings...
Definition: qstring.cpp:6526
QImageIOHandler * handler
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
Definition: qchar.h:55
static void setMouseHandler(QWSMouseHandler *)
Sets the primary mouse driver to be the given driver.

◆ processEventQueue()

void QWSServer::processEventQueue ( )
static
Warning
This function is not part of the public interface.

Definition at line 1963 of file qwindowsystem_qws.cpp.

Referenced by QWSDisplay::Data::fillQueue(), and QEventDispatcherQWS::processEvents().

1964 {
1965  if (qwsServerPrivate)
1967 }
const T value(const Key &key) const
Returns the value associated with the key key.
Definition: qmap.h:499
static QWSServerPrivate * qwsServerPrivate
void doClient(QWSClient *)

◆ processKeyEvent()

void QWSServer::processKeyEvent ( int  unicode,
int  keycode,
Qt::KeyboardModifiers  modifiers,
bool  isPress,
bool  autoRepeat 
)
static

Processes the given key event.

The key is identified by its unicode value and the given keycode, modifiers, isPress and autoRepeat parameters.

The keycode parameter is the Qt keycode value as defined by the Qt::Key enum. The modifiers is an OR combination of Qt::KeyboardModifier values, indicating whether Shift/Alt/Ctrl keys are pressed. The isPress parameter is true if the event is a key press event and autoRepeat is true if the event is caused by an auto-repeat mechanism and not an actual key press.

This function is typically called internally by keyboard drivers. Note that this function can only be used in the server process.

See also
sendKeyEvent(), {Qt for Embedded Linux Character Input}

Definition at line 4248 of file qwindowsystem_qws.cpp.

Referenced by QWSKeyboardHandler::processKeyEvent(), QVFbKeyboardHandler::readKeyboardData(), and QWSUmKeyboardHandlerPrivate::readKeyboardData().

4250 {
4251  bool block;
4252  // Don't block the POWER or LIGHT keys
4253  if ( keycode == Qt::Key_F34 || keycode == Qt::Key_F35 )
4254  block = false;
4255  else
4257 
4258 #ifdef EVENT_BLOCK_DEBUG
4259  qDebug() << "processKeyEvent" << unicode << keycode << modifiers << isPress << autoRepeat << (block ? "block" : "pass");
4260 #endif
4261 
4262  // If we press a key and it's going to be blocked, wake up the screen
4263  if (block) {
4264  if (isPress)
4266  return;
4267  }
4268 
4269  if (keyFilters) {
4270  for (int i = 0; i < keyFilters->size(); ++i) {
4271  QWSServer::KeyboardFilter *keyFilter = keyFilters->at(i);
4272  if (keyFilter->filter(unicode, keycode, modifiers, isPress, autoRepeat))
4273  return;
4274  }
4275  }
4276  sendKeyEvent(unicode, keycode, modifiers, isPress, autoRepeat);
4277 }
The KeyboardFilter class is a base class for global keyboard event filters in Qt for Embedded Linux...
int keycode
#define KEY
bool screensaverblockevent(int index, int *screensaverinterval, bool isDown)
Q_CORE_EXPORT void qDebug(const char *,...)
static void sendKeyEvent(int unicode, int keycode, Qt::KeyboardModifiers modifiers, bool isPress, bool autoRepeat)
Sends the given key event.
static QWSServerPrivate * qwsServerPrivate
virtual bool filter(int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat)=0
Implement this function to return true if a given key event should be stopped from being processed an...
static QList< QWSServer::KeyboardFilter * > * keyFilters

◆ refresh() [1/2]

void QWSServer::refresh ( )

Refreshes the display by making the screen driver update the entire display.

See also
QScreen::exposeRegion()

Definition at line 2213 of file qwindowsystem_qws.cpp.

Referenced by endDisplayReconfigure(), QWSTtyKbPrivate::handleConsoleSwitch(), and QApplicationPrivate::setScreenTransformation().

2214 {
2215  Q_D(QWSServer);
2216  d->exposeRegion(QScreen::instance()->region());
2217 //### send repaint to non-buffered windows
2218 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
static QScreen * instance()
Returns a pointer to the application&#39;s QScreen instance.
Definition: qscreen_qws.h:201
The QWSServer class encapsulates a server process in Qt for Embedded Linux.

◆ refresh() [2/2]

void QWSServer::refresh ( QRegion region)

Refreshes the given region of the display.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 2229 of file qwindowsystem_qws.cpp.

2230 {
2231  Q_D(QWSServer);
2232  d->exposeRegion(r);
2233 //### send repaint to non-buffered windows
2234 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
The QWSServer class encapsulates a server process in Qt for Embedded Linux.

◆ removedChannel

void QWSServer::removedChannel ( const QString channel)
signal

This signal is emitted immediately after the given the QCopChannel object specified by channel, is destroyed.

Note that a channel is not destroyed until all its listeners have been unregistered.

See also
newChannel()

◆ removeKeyboardFilter()

void QWSServer::removeKeyboardFilter ( )
static

Removes and deletes the most recently added filter.

Note that the programmer is responsible for removing each added keyboard filter.

Note that this function can only be used in the server process.

See also
addKeyboardFilter()

Definition at line 4323 of file qwindowsystem_qws.cpp.

4324 {
4325  if (!keyFilters || keyFilters->isEmpty())
4326  return;
4327  delete keyFilters->takeAt(0);
4328 }
static QList< QWSServer::KeyboardFilter * > * keyFilters

◆ resetInputMethod()

void QWSServer::resetInputMethod ( )
static
Warning
This function is not part of the public interface.

Definition at line 3350 of file qwindowsystem_qws.cpp.

3351 {
3352  if (current_IM && qwsServer) {
3353  current_IM->reset();
3354  }
3355 }
static QWSInputMethod * current_IM
virtual void reset()
Resets the state of the input method.
QWSServer Q_GUI_EXPORT * qwsServer

◆ resumeMouse()

void QWSServer::resumeMouse ( )

Resumes pointer handling by reactivating all the mouse drivers registered by the QWS_MOUSE_PROTO environment variable.

See also
suspendMouse(), QWSMouseHandler::resume()

Definition at line 3790 of file qwindowsystem_qws.cpp.

Referenced by QWSTtyKbPrivate::handleConsoleSwitch().

3791 {
3792  Q_D(QWSServer);
3793  for (int i=0; i < d->mousehandlers.size(); ++i)
3794  d->mousehandlers.at(i)->resume();
3795 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
The QWSServer class encapsulates a server process in Qt for Embedded Linux.

◆ screenSaverActivate()

void QWSServer::screenSaverActivate ( bool  activate)
static

Activates the screen saver if activate is true; otherwise it is deactivated.

Note that this function can only be used in the server process.

See also
screenSaverActive(), setScreenSaver()

Definition at line 4565 of file qwindowsystem_qws.cpp.

4566 {
4567  if (activate)
4569  else
4571 }
static QWSServerPrivate * qwsServerPrivate

◆ screenSaverActive()

bool QWSServer::screenSaverActive ( )
static

Returns true if the screen saver is active; otherwise returns false.

Note that this function can only be used in the server process.

See also
screenSaverActivate()

Definition at line 4543 of file qwindowsystem_qws.cpp.

4544 {
4547 }
QTimer * screensavertimer
bool isActive() const
Returns true if the timer is running (pending); otherwise returns false.
Definition: qtimer.h:69
static QWSServerPrivate * qwsServerPrivate

◆ sendIMEvent()

void QWSServer::sendIMEvent ( const QInputMethodEvent event)

Sends the given input method event.

The QInputMethodEvent class is derived from QWSEvent, i.e., it is a QWSEvent object of the QWSEvent::IMEvent type.

If there is a window actively composing the preedit string, the event is sent to that window. Otherwise, the event is sent to the window currently in focus.

See also
sendIMQuery(), QWSInputMethod::sendEvent()

Definition at line 2801 of file qwindowsystem_qws.cpp.

Referenced by QWSInputMethod::sendCommitString(), QWSInputMethod::sendEvent(), and QWSInputMethod::sendPreeditString().

2802 {
2803  QWSIMEvent event;
2804 
2807 
2808  //if currently composing then event must go to the composing window
2809 
2812 
2813  event.simpleData.window = win ? win->winId() : 0;
2814  event.simpleData.replaceFrom = ime->replacementStart();;
2815  event.simpleData.replaceLength = ime->replacementLength();
2816 
2817  QBuffer buffer;
2818  buffer.open(QIODevice::WriteOnly);
2819  QDataStream out(&buffer);
2820 
2821  out << ime->preeditString();
2822  out << ime->commitString();
2823 
2824  const QList<QInputMethodEvent::Attribute> &attributes = ime->attributes();
2825  for (int i = 0; i < attributes.count(); ++i) {
2826  const QInputMethodEvent::Attribute &a = attributes.at(i);
2827  out << a.type << a.start << a.length << a.value;
2828  }
2829  event.setData(buffer.data(), buffer.size());
2830  QWSClient *serverClient = qwsServerPrivate->clientMap.value(-1);
2831  if (serverClient)
2832  serverClient->sendEvent(&event);
2833  if (win && win->client() && win->client() != serverClient)
2834  win->client()->sendEvent(&event);
2835 
2836  current_IM_composing_win = ime->preeditString().isEmpty() ? 0 : win;
2837  current_IM_winId = win ? win->winId() : 0;
2838 }
void sendEvent(QWSEvent *event)
The QInputMethodEvent::Attribute class stores an input method attribute.
Definition: qevent.h:441
const QByteArray & data() const
Returns the data contained in the buffer.
Definition: qbuffer.cpp:301
bool open(OpenMode openMode)
Reimplemented Function
Definition: qbuffer.cpp:338
QWSClient * client() const
Returns a reference to the QWSClient object that owns this window.
static int current_IM_winId
qint64 size() const
Reimplemented Function
Definition: qbuffer.cpp:375
long ASN1_INTEGER_get ASN1_INTEGER * a
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
QWSWindow * focusw
The QBuffer class provides a QIODevice interface for a QByteArray.
Definition: qbuffer.h:57
virtual bool event(QEvent *)
This virtual function receives events to an object and should return true if the event e was recogniz...
Definition: qobject.cpp:1200
The QWSWindow class encapsulates a top-level window in Qt for Embedded Linux.
const T value(const Key &key) const
Returns the value associated with the key key.
Definition: qmap.h:499
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
static QWSServerPrivate * qwsServerPrivate
int winId() const
Returns the window&#39;s ID.
static QWSWindow * current_IM_composing_win
static QWSWindow * keyboardGrabber
The QDataStream class provides serialization of binary data to a QIODevice.
Definition: qdatastream.h:71
The QWSClient class encapsulates a client process in Qt for Embedded Linux.

◆ sendIMQuery()

void QWSServer::sendIMQuery ( int  property)

Sends an input method query for the given property.

To receive responses to input method queries, the virtual QWSInputMethod::queryResponse() function must be reimplemented in a QWSInputMethod subclass that is activated using the setCurrentInputMethod() function.

See also
sendIMEvent(), setCurrentInputMethod()

Definition at line 2851 of file qwindowsystem_qws.cpp.

Referenced by QWSInputMethod::sendQuery().

2852 {
2854 
2859 
2860  event.simpleData.window = win ? win->winId() : 0;
2861  event.simpleData.property = property;
2862  if (win && win->client())
2863  win->client()->sendEvent(&event);
2864 }
void sendEvent(QWSEvent *event)
QWSClient * client() const
Returns a reference to the QWSClient object that owns this window.
QWSWindow * focusw
virtual bool event(QEvent *)
This virtual function receives events to an object and should return true if the event e was recogniz...
Definition: qobject.cpp:1200
The QWSWindow class encapsulates a top-level window in Qt for Embedded Linux.
static QWSServerPrivate * qwsServerPrivate
int winId() const
Returns the window&#39;s ID.
static QWSWindow * current_IM_composing_win
QVariant property(const char *name) const
Returns the value of the object&#39;s name property.
Definition: qobject.cpp:3807
static QWSWindow * keyboardGrabber

◆ sendKeyEvent()

void QWSServer::sendKeyEvent ( int  unicode,
int  keycode,
Qt::KeyboardModifiers  modifiers,
bool  isPress,
bool  autoRepeat 
)
static

Sends the given key event.

The key is identified by its unicode value and the given keycode, modifiers, isPress and autoRepeat parameters.

Use this function to send key events generated by "virtual keyboards" (note that the processKeyEvent() function is impelemented using this function).

The keycode parameter is the Qt keycode value as defined by the Qt::Key enum. The modifiers is an OR combination of Qt::KeyboardModifier values, indicating whether Shift/Alt/Ctrl keys are pressed. The isPress parameter is true if the event is a key press event and autoRepeat is true if the event is caused by an auto-repeat mechanism and not an actual key press.

Note that this function can only be used in the server process.

See also
processKeyEvent(), {Qt for Embedded Linux Character Input}

Definition at line 2652 of file qwindowsystem_qws.cpp.

Referenced by QVNCServer::keyEvent(), and processKeyEvent().

2654 {
2655  qws_keyModifiers = modifiers;
2656 
2657  if (isPress) {
2658  if (keycode != Qt::Key_F34 && keycode != Qt::Key_F35)
2660  }
2661 
2662 #ifndef QT_NO_QWS_INPUTMETHODS
2663 
2664  if (!current_IM || !current_IM->filter(unicode, keycode, modifiers, isPress, autoRepeat))
2665  QWSServerPrivate::sendKeyEventUnfiltered(unicode, keycode, modifiers, isPress, autoRepeat);
2666 #else
2667  QWSServerPrivate::sendKeyEventUnfiltered(unicode, keycode, modifiers, isPress, autoRepeat);
2668 #endif
2669 }
int keycode
virtual bool filter(int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat)
Filters the key input identified by the given unicode, keycode, modifiers, isPress and autoRepeat par...
static QWSInputMethod * current_IM
static int qws_keyModifiers
static QWSServerPrivate * qwsServerPrivate
static void sendKeyEventUnfiltered(int unicode, int keycode, Qt::KeyboardModifiers modifiers, bool isPress, bool autoRepeat)

◆ sendMouseEvent()

void QWSServer::sendMouseEvent ( const QPoint pos,
int  state,
int  wheel = 0 
)
static

Send a mouse event.

Warning
This function is not part of the public interface.

pos is the screen position where the mouse event occurred and state is a mask indicating which buttons are pressed.

pos is in device coordinates

Definition at line 2334 of file qwindowsystem_qws.cpp.

Referenced by QWSMouseHandler::mouseChanged(), and QVNCServer::pointerEvent().

2335 {
2337 #ifdef EVENT_BLOCK_DEBUG
2338  qDebug() << "sendMouseEvent" << pos.x() << pos.y() << state << (block ? "block" : "pass");
2339 #endif
2340 
2341  if (state || wheel)
2343 
2344  if ( block )
2345  return;
2346 
2347  QPoint tpos;
2348  // transformations
2349  if (qt_screen->isTransformed()) {
2351  tpos = qt_screen->mapFromDevice(pos, s);
2352  } else {
2353  tpos = pos;
2354  }
2355 
2356  if (qt_last_x) {
2357  *qt_last_x = tpos.x();
2358  *qt_last_y = tpos.y();
2359  }
2360  QWSServer::mousePosition = tpos;
2361  qwsServerPrivate->mouseState = state;
2362 
2363 #ifndef QT_NO_QWS_INPUTMETHODS
2364  const int btnMask = Qt::LeftButton | Qt::RightButton | Qt::MidButton;
2365  int stroke_count; // number of strokes to keep shown.
2367  {
2368  stroke_count = 0;
2369  } else {
2370  stroke_count = current_IM->filter(tpos, state, wheel);
2371  }
2372 
2373  if (stroke_count == 0) {
2374  if (state&btnMask)
2375  force_reject_strokeIM = true;
2376  QWSServerPrivate::sendMouseEventUnfiltered(tpos, state, wheel);
2377  }
2378  // stop force reject after stroke ends.
2379  if (state&btnMask && force_reject_strokeIM)
2380  force_reject_strokeIM = false;
2381  // on end of stroke, force_rejct
2382  // and once a stroke is rejected, do not try again till pen is lifted
2383 #else
2384  QWSServerPrivate::sendMouseEventUnfiltered(tpos, state, wheel);
2385 #endif // end QT_NO_QWS_FSIM
2386 }
Q_GUI_EXPORT QScreen * qt_screen
Definition: qscreen_qws.cpp:69
int deviceWidth() const
Returns the physical width of the framebuffer device in pixels.
Definition: qscreen_qws.h:233
virtual QSize mapFromDevice(const QSize &) const
Maps the given size from the framebuffer coordinate system to the coordinate space used by the applic...
virtual bool filter(int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat)
Filters the key input identified by the given unicode, keycode, modifiers, isPress and autoRepeat par...
static void sendMouseEventUnfiltered(const QPoint &pos, int state, int wheel=0)
static QWSInputMethod * current_IM
bool screensaverblockevent(int index, int *screensaverinterval, bool isDown)
Q_CORE_EXPORT void qDebug(const char *,...)
int * qt_last_x
int * qt_last_y
static QWSServerPrivate * qwsServerPrivate
int deviceHeight() const
Returns the full height of the framebuffer device in pixels.
Definition: qscreen_qws.h:234
virtual bool isTransformed() const
Returns true if the screen is transformed (for instance, rotated 90 degrees); otherwise returns false...
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
#define MOUSE
int y() const
Returns the y coordinate of this point.
Definition: qpoint.h:131
static QPoint mousePosition
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53
int x() const
Returns the x coordinate of this point.
Definition: qpoint.h:128
static bool force_reject_strokeIM

◆ sendPropertyNotifyEvent()

void QWSServer::sendPropertyNotifyEvent ( int  property,
int  state 
)
Warning
This function is not part of the public interface.

Definition at line 2896 of file qwindowsystem_qws.cpp.

2897 {
2898  Q_D(QWSServer);
2899  QWSServerPrivate::ClientIterator it = d->clientMap.begin();
2900  while (it != d->clientMap.end()) {
2901  QWSClient *cl = *it;
2902  ++it;
2903  cl->sendPropertyNotifyEvent(property, state);
2904  }
2905 }
double d
Definition: qnumeric_p.h:62
#define it(className, varName)
void sendPropertyNotifyEvent(int property, int state)
#define Q_D(Class)
Definition: qglobal.h:2482
The QWSServer class encapsulates a server process in Qt for Embedded Linux.
The QMap::iterator class provides an STL-style non-const iterator for QMap and QMultiMap.
Definition: qmap.h:233
QVariant property(const char *name) const
Returns the value of the object&#39;s name property.
Definition: qobject.cpp:3807
The QWSClient class encapsulates a client process in Qt for Embedded Linux.

◆ setBackground()

void QWSServer::setBackground ( const QBrush brush)
static

Sets the brush used as background in the absence of obscuring windows, to be the given brush.

Note that this function can only be used in the server process.

See also
backgroundBrush()

Definition at line 4126 of file qwindowsystem_qws.cpp.

4127 {
4129  QWSServerPrivate::bgBrush = new QBrush(brush);
4130  else
4131  *QWSServerPrivate::bgBrush = brush;
4132  if (!qwsServer)
4133  return;
4135 }
Q_GUI_EXPORT QScreen * qt_screen
Definition: qscreen_qws.cpp:69
int height() const
Returns the logical height of the framebuffer in pixels.
Definition: qscreen_qws.h:228
int width() const
Returns the logical width of the framebuffer in pixels.
Definition: qscreen_qws.h:227
static QBrush * bgBrush
The QBrush class defines the fill pattern of shapes drawn by QPainter.
Definition: qbrush.h:76
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
virtual void exposeRegion(QRegion r, int changing)
This function is called by the Qt for Embedded Linux server whenever a screen update is required...
QWSServer Q_GUI_EXPORT * qwsServer

◆ setCurrentInputMethod()

void QWSServer::setCurrentInputMethod ( QWSInputMethod method)
static

Sets the current input method to be the given method.

Note that this function can only be used in the server process.

See also
sendIMQuery(), sendIMEvent()

Definition at line 2877 of file qwindowsystem_qws.cpp.

2878 {
2879  if (current_IM)
2880  current_IM->reset(); //??? send an update event instead ?
2881  current_IM = im;
2882 }
static QWSInputMethod * current_IM
virtual void reset()
Resets the state of the input method.

◆ setCursorVisible()

void QWSServer::setCursorVisible ( bool  visible)
static

Shows the cursor if visible is true: otherwise the cursor is hidden.

Note that this function can only be used in the server process.

See also
isCursorVisible()

Definition at line 2761 of file qwindowsystem_qws.cpp.

Referenced by openMouse().

2762 {
2768  }
2769 }
unsigned char c[8]
Definition: qnumeric_p.h:62
static QWSCursor * systemCursor(int id)
static QWSServerPrivate * qwsServerPrivate
QWSCursor * cursor
void setCursor(QWSCursor *curs)

◆ setDefaultKeyboard()

void QWSServer::setDefaultKeyboard ( const char *  keyboardDriver)
static

Sets the keyboard driver that will be used if the QWS_KEYBOARD environment variable is not defined, to be the given keyboardDriver.

Note that the default is platform-dependent. This function can only be used in the server process.

See also
setKeyboardHandler(), {Qt for Embedded Linux Character Input}

Definition at line 2309 of file qwindowsystem_qws.cpp.

Referenced by QIntfbScreen::connect(), QVNCScreen::connect(), QVFbScreen::initDevice(), and QDirectFBScreen::initDevice().

2310 {
2312 }
static QString fromAscii(const char *, int size=-1)
Returns a QString initialized with the first size characters from the string str. ...
Definition: qstring.cpp:4276
defaultKeyboard

◆ setDefaultMouse()

void QWSServer::setDefaultMouse ( const char *  mouseDriver)
static

Sets the mouse driver that will be used if the QWS_MOUSE_PROTO environment variable is not defined, to be the given mouseDriver.

Note that the default is platform-dependent. This function can only be used in the server process.

See also
setMouseHandler(), {Qt for Embedded Linux Pointer Handling}

Definition at line 2292 of file qwindowsystem_qws.cpp.

Referenced by QIntfbScreen::connect(), QVNCScreen::connect(), QVFbScreen::initDevice(), and QDirectFBScreen::initDevice().

2293 {
2294  *defaultMouse() = QString::fromAscii(m);
2295 }
static QString fromAscii(const char *, int size=-1)
Returns a QString initialized with the first size characters from the string str. ...
Definition: qstring.cpp:4276

◆ setKeyboardHandler()

void QWSServer::setKeyboardHandler ( QWSKeyboardHandler driver)
static

Sets the primary keyboard driver to be the given driver.

Qt for Embedded Linux provides several ready-made keyboard drivers, and custom drivers are typically added using Qt's plugin mechanism. See the Qt for Embedded Linux Character Input documentation for details.

Note that this function can only be used in the server process.

See also
keyboardHandler(), setDefaultKeyboard()

Definition at line 3874 of file qwindowsystem_qws.cpp.

Referenced by openKeyboard().

3875 {
3876  if (!kh)
3877  return;
3880 }
void prepend(const T &t)
Inserts value at the beginning of the list.
Definition: qlist.h:541
static QWSServerPrivate * qwsServerPrivate
QList< QWSKeyboardHandler * > keyboardhandlers
int removeAll(const T &t)
Removes all occurrences of value in the list and returns the number of entries removed.
Definition: qlist.h:770

◆ setMaxWindowRect()

void QWSServer::setMaxWindowRect ( const QRect rectangle)
static

Sets the maximum area of the screen that Qt for Embedded Linux applications can use, to be the given rectangle.

Note that this function can only be used in the server process.

See also
QWidget::showMaximized()

Definition at line 2249 of file qwindowsystem_qws.cpp.

2250 {
2251  QList<QScreen*> subScreens = qt_screen->subScreens();
2252  if (subScreens.isEmpty() && qt_screen != 0)
2253  subScreens.append(qt_screen);
2254 
2255  for (int i = 0; i < subScreens.size(); ++i) {
2256  const QScreen *screen = subScreens.at(i);
2257  const QRect r = (screen->region() & rect).boundingRect();
2258  if (r.isEmpty())
2259  continue;
2260 
2262  if (ap->maxWindowRect(screen) != r) {
2263  ap->setMaxWindowRect(screen, i, r);
2265  }
2266  }
2267 }
Q_GUI_EXPORT QScreen * qt_screen
Definition: qscreen_qws.cpp:69
void setMaxWindowRect(const QScreen *screen, int screenNo, const QRect &rect)
QRect maxWindowRect(const QScreen *screen) const
static QApplicationPrivate * instance()
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152
static const QRectF boundingRect(const QPointF *points, int pointCount)
virtual QRegion region() const
Returns the region covered by this screen driver.
Definition: qscreen_qws.h:284
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507
void sendMaxWindowRectEvents(const QRect &rect)
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
static QWSServerPrivate * qwsServerPrivate
bool isEmpty() const
Returns true if the rectangle is empty, otherwise returns false.
Definition: qrect.h:234
virtual QList< QScreen * > subScreens() const
Definition: qscreen_qws.h:283
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
The QScreen class is a base class for screen drivers in Qt for Embedded Linux.
Definition: qscreen_qws.h:191
The QList class is a template class that provides lists.
Definition: qdatastream.h:62

◆ setMouseHandler()

void QWSServer::setMouseHandler ( QWSMouseHandler driver)
static

Sets the primary mouse driver to be the given driver.

Qt for Embedded Linux provides several ready-made mouse drivers, and custom drivers are typically added using Qt's plugin mechanism. See the Qt for Embedded Linux Pointer Handling documentation for details.

Note that this function can only be used in the server process.

See also
mouseHandler(), setDefaultMouse()

Definition at line 2534 of file qwindowsystem_qws.cpp.

Referenced by openMouse().

2535 {
2536  if (!mh)
2537  return;
2540 }
QList< QWSMouseHandler * > mousehandlers
void prepend(const T &t)
Inserts value at the beginning of the list.
Definition: qlist.h:541
static QWSServerPrivate * qwsServerPrivate
int removeAll(const T &t)
Removes all occurrences of value in the list and returns the number of entries removed.
Definition: qlist.h:770

◆ setScreenSaver()

void QWSServer::setScreenSaver ( QWSScreenSaver screenSaver)
static

Installs the given screenSaver, deleting the current screen saver.

Note that this function can only be used in the server process.

See also
screenSaverActivate(), setScreenSaverInterval(), setScreenSaverIntervals(), setScreenSaverBlockLevel()

Definition at line 4474 of file qwindowsystem_qws.cpp.

4475 {
4476  QWSServerPrivate *qd = qwsServer->d_func();
4477  delete qd->saver;
4478  qd->saver = ss;
4479 }
QWSScreenSaver * saver
QWSServer Q_GUI_EXPORT * qwsServer

◆ setScreenSaverBlockLevel()

void QWSServer::setScreenSaverBlockLevel ( int  eventBlockLevel)
static

Block the key or mouse event that wakes the system from level eventBlockLevel or higher.

To completely disable event blocking (the default behavior), set eventBlockLevel to -1.

The algorithm blocks the "down", "up" as well as any "repeat" events for the same key but will not block other key events after the initial "down" event. For mouse events, the algorithm blocks all mouse events until an event with no buttons pressed is received.

There are 2 keys that are never blocked, Qt::Key_F34 (POWER) and Qt::Key_F35 (LIGHT).

Example usage:

bool MyScreenSaver::save( int level )
{
switch ( level ) {
case 0:
if ( dim_enabled ) {
// dim the screen
}
return true;
case 1:
if ( screenoff_enabled ) {
// turn off the screen
}
return true;
case 2:
if ( suspend_enabled ) {
// suspend
}
return true;
default:
return false;
}
}
...
int timings[4];

Note that this function can only be used in the server process.

See also
setScreenSaverIntervals(), setScreenSaverInterval()

Definition at line 4417 of file qwindowsystem_qws.cpp.

4418 {
4419  if (!qwsServerPrivate)
4420  return;
4421  qwsServerPrivate->screensavereventblocklevel = eventBlockLevel;
4422 #ifdef EVENT_BLOCK_DEBUG
4423  qDebug() << "QWSServer::setScreenSaverBlockLevel() " << eventBlockLevel;
4424 #endif
4425 }
Q_CORE_EXPORT void qDebug(const char *,...)
static QWSServerPrivate * qwsServerPrivate

◆ setScreenSaverInterval()

void QWSServer::setScreenSaverInterval ( int  milliseconds)
static

Sets the timeout interval for the screensaver to the specified milliseconds.

To turn off the screensaver, set the timout interval to 0.

Note that this function can only be used in the server process.

See also
setScreenSaverIntervals(), setScreenSaverBlockLevel()

Definition at line 4391 of file qwindowsystem_qws.cpp.

4392 {
4393  int v[2];
4394  v[0] = ms;
4395  v[1] = 0;
4397 }
static void setScreenSaverIntervals(int *ms)
Specifies the time intervals (in milliseconds) between the different levels of screen responsiveness...

◆ setScreenSaverIntervals()

void QWSServer::setScreenSaverIntervals ( int *  intervals)
static

Specifies the time intervals (in milliseconds) between the different levels of screen responsiveness.

Qt for Embedded Linux supports multilevel screen saving, i.e., it is possible to specify several different levels of screen responsiveness by implementing the QWSScreenSaver::save() function. For example, you can choose to first turn off the light before you fully activate the screensaver. See the QWSScreenSaver documentation for details.

Note that an interval of 0 milliseconds will turn off the screensaver, and that the intervals array must be 0-terminated. This function can only be used in the server process.

See also
setScreenSaverInterval(), setScreenSaverBlockLevel()

Definition at line 4350 of file qwindowsystem_qws.cpp.

Referenced by setScreenSaverInterval().

4351 {
4352  if (!qwsServerPrivate)
4353  return;
4354 
4356  if (ms) {
4357  int* t=ms;
4358  int n=0;
4359  while (*t++) n++;
4360  if (n) {
4361  n++; // the 0
4362  qwsServerPrivate->screensaverintervals = new int[n];
4363  memcpy(qwsServerPrivate->screensaverintervals, ms, n*sizeof(int));
4364  } else {
4366  }
4367  } else {
4369  }
4371 
4373  qt_screen->blank(false);
4375 }
Q_GUI_EXPORT QScreen * qt_screen
Definition: qscreen_qws.cpp:69
QTimer * screensavertimer
static QWSServerPrivate * qwsServerPrivate
virtual void blank(bool on)
Prevents the screen driver form displaying any content on the screen.
void stop()
Stops the timer.
Definition: qtimer.cpp:284

◆ startup()

void QWSServer::startup ( int  flags)
static
Warning
This function is not part of the public interface.

Definition at line 4195 of file qwindowsystem_qws.cpp.

Referenced by qt_init().

4196 {
4197  if (qwsServer)
4198  return;
4199  unlink(qws_qtePipeFilename().toLatin1().constData());
4200  (void)new QWSServer(flags);
4201 }
QString qws_qtePipeFilename()
QWSServer(int flags=0, QObject *parent=0)
QWSServer Q_GUI_EXPORT * qwsServer

◆ suspendMouse()

void QWSServer::suspendMouse ( )

Suspends pointer handling by deactivating all the mouse drivers registered by the QWS_MOUSE_PROTO environment variable.

See also
resumeMouse(), QWSMouseHandler::suspend()

Definition at line 3777 of file qwindowsystem_qws.cpp.

Referenced by QWSTtyKbPrivate::handleConsoleSwitch().

3778 {
3779  Q_D(QWSServer);
3780  for (int i=0; i < d->mousehandlers.size(); ++i)
3781  d->mousehandlers.at(i)->suspend();
3782 }
double d
Definition: qnumeric_p.h:62
#define Q_D(Class)
Definition: qglobal.h:2482
The QWSServer class encapsulates a server process in Qt for Embedded Linux.

◆ timerEvent()

void QWSServer::timerEvent ( QTimerEvent e)
protectedvirtual
Warning
This function is not part of the public interface.

Reimplemented from QObject.

Definition at line 1575 of file qwindowsystem_qws.cpp.

1576 {
1577  Q_D(QWSServer);
1578  if (e->timerId() == d->fontCleanupTimer.timerId()) {
1579  d->cleanupFonts();
1580  d->fontCleanupTimer.stop();
1581  } else {
1583  }
1584 }
double d
Definition: qnumeric_p.h:62
virtual void timerEvent(QTimerEvent *)
This event handler can be reimplemented in a subclass to receive timer events for the object...
Definition: qobject.cpp:1294
#define Q_D(Class)
Definition: qglobal.h:2482
int timerId() const
Returns the unique timer identifier, which is the same identifier as returned from QObject::startTime...
Definition: qcoreevent.h:346
The QWSServer class encapsulates a server process in Qt for Embedded Linux.

◆ updateWindowRegions()

void QWSServer::updateWindowRegions ( ) const
private
Warning
This function is not part of the public interface.

Definition at line 4552 of file qwindowsystem_qws.cpp.

Referenced by QApplicationPrivate::setScreenTransformation().

4553 {
4555 }
static QWSServerPrivate * qwsServerPrivate

◆ windowAt()

QWSWindow * QWSServer::windowAt ( const QPoint position)

Returns the window containing the given position.

Note that if there is no window under the specified point this function returns 0.

See also
clientWindows(), instance()

Definition at line 2606 of file qwindowsystem_qws.cpp.

Referenced by QWSServerPrivate::sendMouseEventUnfiltered(), QWSServerPrivate::updateClientCursorPos(), and QWSDisplay::windowAt().

2607 {
2608  Q_D(QWSServer);
2609  for (int i=0; i<d->windows.size(); ++i) {
2610  QWSWindow* w = d->windows.at(i);
2611  if (w->allocatedRegion().contains(pos))
2612  return w;
2613  }
2614  return 0;
2615 }
double d
Definition: qnumeric_p.h:62
QRegion allocatedRegion() const
Returns the region that the window is allowed to draw onto, including any window decorations but excl...
#define Q_D(Class)
Definition: qglobal.h:2482
The QWSWindow class encapsulates a top-level window in Qt for Embedded Linux.
bool contains(const QPoint &p) const
Returns true if the region contains the point p; otherwise returns false.
Definition: qregion.cpp:4104
The QWSServer class encapsulates a server process in Qt for Embedded Linux.

◆ windowEvent

QWSServer::windowEvent ( QWSWindow window,
QWSServer::WindowEvent  eventType 
)
signal

This signal is emitted whenever something happens to a top-level window (e.g., it's created or destroyed), passing a pointer to the window and the event's type in the window and eventType parameters, respectively.

See also
markedText()

◆ windowList()

QList< QWSInternalWindowInfo * > * QWSServer::windowList ( )
static
Warning
This function is not part of the public interface.

Definition at line 2547 of file qwindowsystem_qws.cpp.

Referenced by QWSDisplay::windowList().

2548 {
2550  for (int i=0; i < qwsServerPrivate->windows.size(); ++i) {
2553  qwi->winid=window->winId();
2554  qwi->clientid=window->client()->clientId();
2555  ret->append(qwi);
2556  }
2557  return ret;
2558 }
QWSClient * client() const
Returns a reference to the QWSClient object that owns this window.
The QWSWindow class encapsulates a top-level window in Qt for Embedded Linux.
NSWindow * window
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
static QWSServerPrivate * qwsServerPrivate
int winId() const
Returns the window&#39;s ID.
int clientId() const
Returns an integer uniquely identfying this client.
QList< QWSWindow * > windows
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
The QList class is a template class that provides lists.
Definition: qdatastream.h:62

Friends and Related Functions

◆ QApplicationPrivate

friend class QApplicationPrivate
friend

Definition at line 344 of file qwindowsystem_qws.h.

◆ QCopChannel

friend class QCopChannel
friend

Definition at line 211 of file qwindowsystem_qws.h.

◆ QWSDisplay

friend class QWSDisplay
friend

Definition at line 214 of file qwindowsystem_qws.h.

◆ QWSInputMethod

friend class QWSInputMethod
friend

Definition at line 215 of file qwindowsystem_qws.h.

◆ QWSMouseHandler

friend class QWSMouseHandler
friend

Definition at line 212 of file qwindowsystem_qws.h.

◆ QWSWindow

friend class QWSWindow
friend

Definition at line 213 of file qwindowsystem_qws.h.

Referenced by QWSServerPrivate::newWindow().

Properties

◆ mousePosition

QPoint QWSServer::mousePosition
static

The documentation for this class was generated from the following files: