Qt 4.8
Macros | Functions | Variables
qxcbconnection.cpp File Reference
#include "qxcbconnection.h"
#include "qxcbkeyboard.h"
#include "qxcbscreen.h"
#include "qxcbwindow.h"
#include <QtAlgorithms>
#include <QSocketNotifier>
#include <QtGui/private/qapplication_p.h>
#include <QAbstractEventDispatcher>
#include <QtCore/QDebug>
#include <stdio.h>
#include <errno.h>

Go to the source code of this file.

Macros

#define HANDLE_KEYBOARD_EVENT(event_t, handler)
 
#define HANDLE_PLATFORM_WINDOW_EVENT(event_t, window, handler)
 

Functions

QXcbWindowplatformWindowFromId (xcb_window_t id)
 
void printXcbEvent (const char *message, xcb_generic_event_t *event)
 

Variables

static const char * xcb_atomnames
 
const char * xcb_errors []
 
const char * xcb_protocol_request_codes []
 

Macro Definition Documentation

◆ HANDLE_KEYBOARD_EVENT

#define HANDLE_KEYBOARD_EVENT (   event_t,
  handler 
)
Value:
{ \
event_t *e = (event_t *)event; \
if (QXcbWindow *platformWindow = platformWindowFromId(e->event)) \
m_keyboard->handler(platformWindow->widget(), e); \
} \
break;
QXcbWindow * platformWindowFromId(xcb_window_t id)
EventRef event

Definition at line 165 of file qxcbconnection.cpp.

Referenced by QXcbConnection::processXcbEvents().

◆ HANDLE_PLATFORM_WINDOW_EVENT

#define HANDLE_PLATFORM_WINDOW_EVENT (   event_t,
  window,
  handler 
)
Value:
{ \
event_t *e = (event_t *)event; \
if (QXcbWindow *platformWindow = platformWindowFromId(e->window)) { \
QObjectPrivate *d = QObjectPrivate::get(platformWindow->widget()); \
if (!d->wasDeleted) \
platformWindow->handler(e); \
} \
} \
break;
double d
Definition: qnumeric_p.h:62
QXcbWindow * platformWindowFromId(xcb_window_t id)
EventRef event
static QObjectPrivate * get(QObject *o)
Definition: qobject_p.h:177

Definition at line 154 of file qxcbconnection.cpp.

Referenced by QXcbConnection::processXcbEvents().

Function Documentation

◆ platformWindowFromId()

QXcbWindow* platformWindowFromId ( xcb_window_t  id)

Definition at line 146 of file qxcbconnection.cpp.

147 {
149  if (widget)
150  return static_cast<QXcbWindow *>(widget->platformWindow());
151  return 0;
152 }
QPointer< QWidget > widget
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
static QWidget * find(WId)
Returns a pointer to the widget with window identifer/handle id.
Definition: qwidget.cpp:2517

◆ printXcbEvent()

void printXcbEvent ( const char *  message,
xcb_generic_event_t *  event 
)

Definition at line 175 of file qxcbconnection.cpp.

Referenced by QXcbConnection::processXcbEvents().

176 {
177 #ifdef XCB_EVENT_DEBUG
178 #define PRINT_XCB_EVENT(ev) \
179  case ev: \
180  printf("%s: %d - %s - sequence: %d\n", message, int(ev), #ev, event->sequence); \
181  break;
182 
183  switch (event->response_type & ~0x80) {
184  PRINT_XCB_EVENT(XCB_KEY_PRESS);
185  PRINT_XCB_EVENT(XCB_KEY_RELEASE);
186  PRINT_XCB_EVENT(XCB_BUTTON_PRESS);
187  PRINT_XCB_EVENT(XCB_BUTTON_RELEASE);
188  PRINT_XCB_EVENT(XCB_MOTION_NOTIFY);
189  PRINT_XCB_EVENT(XCB_ENTER_NOTIFY);
190  PRINT_XCB_EVENT(XCB_LEAVE_NOTIFY);
191  PRINT_XCB_EVENT(XCB_FOCUS_IN);
192  PRINT_XCB_EVENT(XCB_FOCUS_OUT);
193  PRINT_XCB_EVENT(XCB_KEYMAP_NOTIFY);
194  PRINT_XCB_EVENT(XCB_EXPOSE);
195  PRINT_XCB_EVENT(XCB_GRAPHICS_EXPOSURE);
196  PRINT_XCB_EVENT(XCB_VISIBILITY_NOTIFY);
197  PRINT_XCB_EVENT(XCB_CREATE_NOTIFY);
198  PRINT_XCB_EVENT(XCB_DESTROY_NOTIFY);
199  PRINT_XCB_EVENT(XCB_UNMAP_NOTIFY);
200  PRINT_XCB_EVENT(XCB_MAP_NOTIFY);
201  PRINT_XCB_EVENT(XCB_MAP_REQUEST);
202  PRINT_XCB_EVENT(XCB_REPARENT_NOTIFY);
203  PRINT_XCB_EVENT(XCB_CONFIGURE_NOTIFY);
204  PRINT_XCB_EVENT(XCB_CONFIGURE_REQUEST);
205  PRINT_XCB_EVENT(XCB_GRAVITY_NOTIFY);
206  PRINT_XCB_EVENT(XCB_RESIZE_REQUEST);
207  PRINT_XCB_EVENT(XCB_CIRCULATE_NOTIFY);
208  PRINT_XCB_EVENT(XCB_CIRCULATE_REQUEST);
209  PRINT_XCB_EVENT(XCB_PROPERTY_NOTIFY);
210  PRINT_XCB_EVENT(XCB_SELECTION_CLEAR);
211  PRINT_XCB_EVENT(XCB_SELECTION_REQUEST);
212  PRINT_XCB_EVENT(XCB_SELECTION_NOTIFY);
213  PRINT_XCB_EVENT(XCB_COLORMAP_NOTIFY);
214  PRINT_XCB_EVENT(XCB_CLIENT_MESSAGE);
215  PRINT_XCB_EVENT(XCB_MAPPING_NOTIFY);
216  default:
217  printf("%s: unknown event - response_type: %d - sequence: %d\n", message, int(event->response_type & ~0x80), int(event->sequence));
218  }
219 #else
220  Q_UNUSED(message);
221  Q_UNUSED(event);
222 #endif
223 }
EventRef event
#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

Variable Documentation

◆ xcb_atomnames

const char* xcb_atomnames
static

Definition at line 475 of file qxcbconnection.cpp.

Referenced by QXcbConnection::initializeAllAtoms().

◆ xcb_errors

const char* xcb_errors[]
Initial value:
=
{
"Success",
"BadRequest",
"BadValue",
"BadWindow",
"BadPixmap",
"BadAtom",
"BadCursor",
"BadFont",
"BadMatch",
"BadDrawable",
"BadAccess",
"BadAlloc",
"BadColor",
"BadGC",
"BadIDChoice",
"BadName",
"BadLength",
"BadImplementation",
"Unknown"
}

Definition at line 225 of file qxcbconnection.cpp.

Referenced by QXcbConnection::handleXcbError().

◆ xcb_protocol_request_codes

const char* xcb_protocol_request_codes[]

Definition at line 248 of file qxcbconnection.cpp.

Referenced by QXcbConnection::handleXcbError().