Qt 4.8
Public Types | Public Functions | Static Public Functions | List of all members
QWSEvent Class Reference

The QWSEvent class encapsulates an event in Qt for Embedded Linux. More...

#include <qwsevent_qws.h>

Inheritance diagram for QWSEvent:
QWSProtocolItem QWSConnectedEvent QWSCreationEvent QWSEmbedEvent QWSFocusEvent QWSFontEvent QWSIMEvent QWSIMInitEvent QWSIMQueryEvent QWSKeyEvent QWSMaxWindowRectEvent QWSMouseEvent QWSPropertyNotifyEvent QWSPropertyReplyEvent QWSQCopMessageEvent QWSRegionEvent QWSScreenTransformationEvent QWSSelectionClearEvent QWSSelectionNotifyEvent QWSSelectionRequestEvent QWSWindowOperationEvent

Public Types

enum  Type {
  NoEvent, Connected, Mouse, Focus,
  Key, Region, Creation, PropertyNotify,
  PropertyReply, SelectionClear, SelectionRequest, SelectionNotify,
  MaxWindowRect, QCopMessage, WindowOperation, IMEvent,
  IMQuery, IMInit, Embed, Font,
  ScreenTransformation, NEvent
}
 This enum describes the origin of the event. More...
 

Public Functions

QWSMouseEventasMouse ()
 
 QWSEvent (int t, int len, char *ptr)
 
int window ()
 
int window () const
 
- Public Functions inherited from QWSProtocolItem
void copyFrom (const QWSProtocolItem *item)
 
 QWSProtocolItem (int t, int len, char *ptr)
 
bool read (QIODevice *s)
 
virtual void setData (const char *data, int len, bool allocateMem=true)
 
void write (QIODevice *s)
 
virtual ~QWSProtocolItem ()
 

Static Public Functions

static QWSEventfactory (int type)
 

Additional Inherited Members

- Public Variables inherited from QWSProtocolItem
int bytesRead
 
bool deleteRaw
 
char * rawDataPtr
 
int rawLen
 
char * simpleDataPtr
 
int simpleLen
 
int type
 

Detailed Description

The QWSEvent class encapsulates an event in Qt for Embedded Linux.

When running a Qt for Embedded Linux application, it either runs as a server or connects to an existing server. All system generated events are passed to the server application which then propagates the event to the appropriate client.

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, and returns its ID to the server upon request. Finally, the server forwards the event, encapsulated by an instance of the QWSEvent class, to the appropriate client.

qt-embedded-client.png

The server communicates with the client applications over the UNIX domain socket. You can retrieve direct access to all the events a client receives from the server, by reimplementing QApplication's QApplication::qwsEventFilter() function.

QWSEvent provides the Type enum specifying the origin of the event. Internally, each type is represented by a QWSEvent subclass, e.g., QWSKeyEvent.

See also
QWSServer, QWSClient, {Qt for Embedded Linux Architecture}

Definition at line 59 of file qwsevent_qws.h.

Enumerations

◆ Type

This enum describes the origin of the event.

  • NoEvent No event has occurred.
  • Connected An application has connected to the server.
  • Mouse A mouse button is pressed or released, or the mouse cursor is moved. See also Qt for Embedded Linux Pointer Handling.
  • Focus A window has lost or received focus.
  • Key A key is pressed or released. See also Qt for Embedded Linux Character Input.
  • Region A region has changed.
  • Creation The server has created an ID, typically for a window.
  • PropertyNotify A property has changed.
  • PropertyReply The server is responding to a request for a property's value.
  • SelectionClear A selection is deleted.
  • SelectionRequest The server has queried for a selection.
  • SelectionNotify A new selection has been created.
  • MaxWindowRect The server has changed the maximum window for an application.
  • QCopMessage A new Qt Cop message has appeared. See also QCopChannel
  • WindowOperation A window operation, e.g. resizing, has occurred.
  • IMEvent An input method has been used to enter text for languages with non-Latin alphabets. See also QWSInputMethod.
  • IMQuery An input method query for a specified property has occurred. See also QWSInputMethod.
  • NEvent The number of events has changed.
  • Embed An event used internally to implement embedded windows. See also QWSEmbedWidget.
  • ScreenTransformation An event used internally to notify the client processes that the screen has changed for example, rotation, etc.
  • Font
  • IMInit
Enumerator
NoEvent 
Connected 
Mouse 
Focus 
Key 
Region 
Creation 
PropertyNotify 
PropertyReply 
SelectionClear 
SelectionRequest 
SelectionNotify 
MaxWindowRect 
QCopMessage 
WindowOperation 
IMEvent 
IMQuery 
IMInit 
Embed 
Font 
ScreenTransformation 
NEvent 

Definition at line 65 of file qwsevent_qws.h.

Constructors and Destructors

◆ QWSEvent()

QWSEvent::QWSEvent ( int  t,
int  len,
char *  ptr 
)
inline
Warning
This function is not part of the public interface.

Definition at line 61 of file qwsevent_qws.h.

61 : QWSProtocolItem(t,len,ptr) {}
const T * ptr(const T &t)
QWSProtocolItem(int t, int len, char *ptr)

Functions

◆ asMouse()

QWSMouseEvent * QWSEvent::asMouse ( )
inline
Warning
This function is not part of the public interface.

Definition at line 90 of file qwsevent_qws.h.

Referenced by QApplication::qwsProcessEvent().

91  { return type == Mouse ? reinterpret_cast<QWSMouseEvent*>(this) : 0; }

◆ factory()

QWSEvent * QWSEvent::factory ( int  type)
static
Warning
This function is not part of the public interface.

Definition at line 46 of file qwsevent_qws.cpp.

Referenced by qt_client_enqueue(), QWSDisplay::Data::readMore(), and window().

47 {
48  QWSEvent *event = 0;
49  switch (type) {
51  event = new QWSConnectedEvent;
52  break;
54  event = new QWSMaxWindowRectEvent;
55  break;
56  case QWSEvent::Mouse:
57  event = new QWSMouseEvent;
58  break;
59  case QWSEvent::Focus:
60  event = new QWSFocusEvent;
61  break;
62  case QWSEvent::Key:
63  event = new QWSKeyEvent;
64  break;
65  case QWSEvent::Region:
66  event = new QWSRegionEvent;
67  break;
68  case QWSEvent::Creation:
69  event = new QWSCreationEvent;
70  break;
71 #ifndef QT_NO_QWS_PROPERTIES
73  event = new QWSPropertyNotifyEvent;
74  break;
76  event = new QWSPropertyReplyEvent;
77  break;
78 #endif // QT_NO_QWS_PROPERTIES
80  event = new QWSSelectionClearEvent;
81  break;
83  event = new QWSSelectionRequestEvent;
84  break;
86  event = new QWSSelectionNotifyEvent;
87  break;
88 #ifndef QT_NO_COP
90  event = new QWSQCopMessageEvent;
91  break;
92 #endif
94  event = new QWSWindowOperationEvent;
95  break;
96 
97 #ifndef QT_NO_QWS_INPUTMETHODS
98  case QWSEvent::IMEvent:
99  event = new QWSIMEvent;
100  break;
101  case QWSEvent::IMQuery:
102  event = new QWSIMQueryEvent;
103  break;
104  case QWSEvent::IMInit:
105  event = new QWSIMInitEvent;
106  break;
107 #endif
108 #ifndef QT_NO_QWSEMBEDWIDGET
109  case QWSEvent::Embed:
110  event = new QWSEmbedEvent;
111  break;
112 #endif
113  case QWSEvent::Font:
114  event = new QWSFontEvent;
115  break;
117  event = new QWSScreenTransformationEvent;
118  break;
119  default:
120  qCritical("QWSEvent::factory() : Unknown event type %08x!", type);
121  }
122  return event;
123 }
EventRef event
The QWSEvent class encapsulates an event in Qt for Embedded Linux.
Definition: qwsevent_qws.h:59
Q_CORE_EXPORT void qCritical(const char *,...)

◆ window() [1/2]

int QWSEvent::window ( )
inline
Warning
This function is not part of the public interface.

Definition at line 92 of file qwsevent_qws.h.

Referenced by QWSDisplay::Data::fillQueue(), QApplication::qwsProcessEvent(), QWSDisplay::Data::waitForRegionAck(), and QWSDisplay::Data::waitForRegionEvents().

92 { return *(reinterpret_cast<int*>(simpleDataPtr)); }

◆ window() [2/2]

int QWSEvent::window ( ) const
inline
Warning
This function is not part of the public interface.

Definition at line 93 of file qwsevent_qws.h.

93 { return *(reinterpret_cast<int*>(simpleDataPtr)); }

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