Qt 4.8
Classes | Functions | Variables
qeventdispatcher_glib_qws.cpp File Reference
#include "qeventdispatcher_glib_qws_p.h"
#include "qapplication.h"
#include "qplatformdefs.h"
#include "private/qwscommand_qws_p.h"
#include "qwsdisplay_qws.h"
#include "qwsevent_qws.h"
#include "qwindowsystem_qws.h"
#include <glib.h>

Go to the source code of this file.

Classes

struct  GQWSEventSource
 
class  QWSEventDispatcherGlibPrivate
 

Functions

QList< QWSCommand * > * qt_get_server_queue ()
 
static gboolean qwsEventSourceCheck (GSource *s)
 
static gboolean qwsEventSourceDispatch (GSource *s, GSourceFunc callback, gpointer user_data)
 
static gboolean qwsEventSourcePrepare (GSource *s, gint *timeout)
 

Variables

QWSDisplayqt_fbdpy
 
static GSourceFuncs qwsEventSourceFuncs
 

Function Documentation

◆ qt_get_server_queue()

QList<QWSCommand*>* qt_get_server_queue ( )

Definition at line 481 of file qapplication_qws.cpp.

Referenced by qwsEventSourceCheck(), and qwsEventSourcePrepare().

482 {
483  return &outgoing;
484 }
static QList< QWSCommand * > outgoing

◆ qwsEventSourceCheck()

static gboolean qwsEventSourceCheck ( GSource *  s)
static

Definition at line 90 of file qeventdispatcher_glib_qws.cpp.

91 {
92  GQWSEventSource *source = reinterpret_cast<GQWSEventSource *>(s);
93  return qt_fbdpy->eventPending() || !source->d->queuedUserInputEvents.isEmpty()
94  || !qt_get_server_queue()->isEmpty() ;
95 }
bool eventPending() const
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152
QWSDisplay * qt_fbdpy
QWSEventDispatcherGlibPrivate * d
QList< QWSCommand * > * qt_get_server_queue()

◆ qwsEventSourceDispatch()

static gboolean qwsEventSourceDispatch ( GSource *  s,
GSourceFunc  callback,
gpointer  user_data 
)
static

Definition at line 97 of file qeventdispatcher_glib_qws.cpp.

98 {
99  GQWSEventSource *source = reinterpret_cast<GQWSEventSource *>(s);
100 
101  //??? ulong marker = XNextRequest(X11->display);
102  do {
103  QWSEvent *event;
105  && !source->d->queuedUserInputEvents.isEmpty()) {
106  // process a pending user input event
107  event = source->d->queuedUserInputEvents.takeFirst();
108  } else if (qt_fbdpy->eventPending()) {
109  event = qt_fbdpy->getEvent();
110 
112  // queue user input events
113 
114  if (event->type == QWSEvent::Mouse || event->type == QWSEvent::Key) {
115  source->d->queuedUserInputEvents.append(event);
116  continue;
117  }
118  }
119  } else {
120  // no event to process
121  break;
122  }
123 
124  // send through event filter
125  if (source->q->filterEvent(event)) {
126  delete event;
127  continue;
128  }
129 
130  bool ret = qApp->qwsProcessEvent(event) == 1;
131  delete event;
132  if (ret) {
133  return true;
134  }
135 
136  } while (qt_fbdpy->eventPending());
137 
138  if (callback)
139  callback(user_data);
140  return true;
141 }
static void callback(AuServer *, AuEventHandlerRec *, AuEvent *e, AuPointer p)
Definition: qsound_x11.cpp:170
bool filterEvent(void *message)
Sends message through the event filter that was set by setEventFilter().
EventRef event
QWSEventDispatcherGlib * q
bool eventPending() const
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152
The QWSEvent class encapsulates an event in Qt for Embedded Linux.
Definition: qwsevent_qws.h:59
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507
T takeFirst()
Removes the first item in the list and returns it.
Definition: qlist.h:489
#define qApp
QWSDisplay * qt_fbdpy
QWSEventDispatcherGlibPrivate * d
QWSEvent * getEvent()
QEventLoop::ProcessEventsFlags flags

◆ qwsEventSourcePrepare()

static gboolean qwsEventSourcePrepare ( GSource *  s,
gint *  timeout 
)
static

Definition at line 81 of file qeventdispatcher_glib_qws.cpp.

82 {
83  if (timeout)
84  *timeout = -1;
85  GQWSEventSource *source = reinterpret_cast<GQWSEventSource *>(s);
86  return qt_fbdpy->eventPending() || !source->d->queuedUserInputEvents.isEmpty()
87  || !qt_get_server_queue()->isEmpty() ;
88 }
bool eventPending() const
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152
QWSDisplay * qt_fbdpy
QWSEventDispatcherGlibPrivate * d
QList< QWSCommand * > * qt_get_server_queue()

Variable Documentation

◆ qt_fbdpy

QWSDisplay* qt_fbdpy

◆ qwsEventSourceFuncs

GSourceFuncs qwsEventSourceFuncs
static
Initial value:
= {
NULL,
NULL,
NULL
}
static gboolean qwsEventSourceDispatch(GSource *s, GSourceFunc callback, gpointer user_data)
static gboolean qwsEventSourcePrepare(GSource *s, gint *timeout)
static gboolean qwsEventSourceCheck(GSource *s)

Definition at line 143 of file qeventdispatcher_glib_qws.cpp.

Referenced by QWSEventDispatcherGlibPrivate::QWSEventDispatcherGlibPrivate().