42 #include "qplatformdefs.h" 56 #include "private/qapplication_p.h" 61 #include <private/qpaintengine_raster_p.h> 64 #include "private/qlock_p.h" 82 #include <private/qwindowsurface_qws_p.h> 83 #include <private/qfontengine_qpf_p.h> 92 #ifndef QT_NO_QWS_MULTIPROCESS 93 #include <sys/param.h> 94 #include <sys/mount.h> 97 #if !defined(QT_NO_SOUND) && !defined(Q_OS_DARWIN) 98 #ifdef QT_USE_OLD_QWS_SOUND 99 #include <sys/types.h> 100 #include <sys/stat.h> 101 #include <sys/ioctl.h> 102 #include <sys/soundcard.h> 132 static const
int FontCleanupInterval = 60 * 1000;
141 static int next=1000;
146 #ifndef QT_NO_QWS_INPUTMETHODS 235 #ifdef QT_QWS_CLIENTBLIT 239 #ifndef QT_NO_QWSEMBEDWIDGET 410 : id(i), modified(false),
411 onTop(false),
c(client), last_focus_time(0), _opacity(255),
475 #ifndef QT_NO_QWS_MULTIPROCESS 484 #ifndef QT_NO_QWS_MULTIPROCESS 500 #ifndef QT_NO_QWSEMBEDWIDGET 502 for (
int i = 0; i < n; ++i)
517 #ifndef QT_NO_QWSEMBEDWIDGET 519 for (
int i = 0; i < n; ++i)
534 #ifndef QT_NO_QWSEMBEDWIDGET 536 for (
int i = 0; i < n; ++i)
551 #ifndef QT_NO_QWSEMBEDWIDGET 553 for (
int i = 0; i < n; ++i)
568 qwsServerPrivate->
setFocus(
this,
true);
569 #ifndef QT_NO_QWSEMBEDWIDGET 571 for (
int i = 0; i < n; ++i)
602 event.simpleData.window =
id;
603 event.simpleData.get_focus =
get;
613 event.simpleData.window =
id;
614 event.simpleData.op = o;
627 #ifndef QT_NO_QWS_INPUTMETHODS 628 if (current_IM_composing_win ==
this)
629 current_IM_composing_win = 0;
631 #ifndef QT_NO_QWSEMBEDWIDGET 641 #ifndef QT_NO_QWS_MULTIPROCESS 643 if (
c &&
c->d_func())
669 #ifdef QT_QWS_CLIENTBLIT 670 QRegion QWSWindow::directPaintRegion()
const 672 return d->directPaintRegion;
675 inline void QWSWindow::setDirectPaintRegion(
const QRegion &r)
677 d->directPaintRegion = r;
701 #ifndef QT_NO_QWSEMBEDWIDGET 714 #endif // QT_NO_QWSEMBEDWIDGET 730 void setLockId(
int id);
731 void unlockCommunication();
734 #ifndef QT_NO_QWS_MULTIPROCESS 745 #ifndef QT_NO_QWS_MULTIPROCESS 748 numUnbufferedSurfaces = 0;
754 #ifndef QT_NO_QWS_MULTIPROCESS 761 #ifdef QT_NO_QWS_MULTIPROCESS 770 #ifndef QT_NO_QWS_MULTIPROCESS 817 #ifdef QT_NO_QWS_MULTIPROCESS 835 #endif //QT_NO_QWS_MULTIPROCESS 845 #ifndef QT_NO_QWS_MULTIPROCESS 850 #ifndef QT_NO_QWS_MULTIPROCESS 854 --
d->numUnbufferedSurfaces;
860 ++
d->numUnbufferedSurfaces;
862 #endif // QT_NO_QWS_MULTIPROCESS 880 #if defined(QWS_SOCKET_DEBUG) 902 #ifndef QT_NO_QWS_MULTIPROCESS 920 #ifdef QT_QWS_CLIENTBLIT
925 #ifndef QT_NO_QWS_MULTIPROCESS 932 event.setData(winid, rgn,
type);
933 #ifdef QT_QWS_CLIENTBLIT 934 event.simpleData.id =
id;
950 event.simpleData.window = 0;
951 event.simpleData.len = strlen(display_spec) + 1;
952 event.simpleData.clientId =
cid;
954 char * tmp=(
char *)display_spec;
965 event.simpleData.window = 0;
966 event.simpleData.rect = rect;
973 #ifndef QT_NO_QWS_PROPERTIES 977 event.simpleData.window = 0;
978 event.simpleData.property =
property;
979 event.simpleData.state = state;
989 event.simpleData.window = 0;
990 event.simpleData.property =
property;
991 event.simpleData.len = len;
992 event.setData(data, len);
995 #endif //QT_NO_QWS_PROPERTIES 1003 event.simpleData.window = windowid;
1013 event.simpleData.window = windowid;
1020 #ifndef QT_NO_QWSEMBEDWIDGET 1028 event.setData(windowid, type, region);
1031 #endif // QT_NO_QWSEMBEDWIDGET 1404 d->initServer(flags);
1407 qwsServerPrivate = 0;
1422 d->initServer(flags);
1427 #ifndef QT_NO_QWS_MULTIPROCESS 1433 static bool ignoreEvents[2] = {
false,
false };
1435 if ( !ignoreEvents[index] ) {
1437 if ( screensaverintervals ) {
1438 if ( screensaverinterval != screensaverintervals ) {
1442 if ( screensaverblockevents && wake ) {
1443 #ifdef EVENT_BLOCK_DEBUG 1444 qDebug(
"waking the screen" );
1446 ignoreEvents[
index] =
true;
1447 }
else if ( !screensaverblockevents ) {
1448 #ifdef EVENT_BLOCK_DEBUG 1449 qDebug(
"the screen was already awake" );
1451 ignoreEvents[
index] =
false;
1455 if ( ignoreEvents[index] ) {
1456 #ifdef EVENT_BLOCK_DEBUG 1459 ignoreEvents[
index] =
false;
1463 return ignoreEvents[
index];
1471 qwsServerPrivate =
this;
1472 disablePainting =
false;
1473 #ifndef QT_NO_QWS_MULTIPROCESS 1477 if ( !ssocket->isListening()) {
1478 perror(
"QWSServerPrivate::initServer: server socket not listening");
1485 setsockopt(ssocket->socketDescriptor(),SOL_SOCKET,SO_LINGER,(
char *)&tmp,
sizeof(tmp));
1492 mouseGrabbing =
false;
1493 inputMethodMouseGrabbed =
false;
1496 #ifndef QT_NO_QWS_CURSOR 1497 haveviscurs =
false;
1502 #ifndef QT_NO_QWS_MULTIPROCESS 1505 #if defined(Q_OS_LINUX) && !defined(QT_LINUXBASE) 1506 if(mount(0,
"/var/shm",
"shm", 0, 0)) {
1517 selectionOwner.windowid = -1;
1518 selectionOwner.time.set(-1, -1, -1, -1);
1529 screensavertimer =
new QTimer(q);
1530 screensavertimer->setSingleShot(
true);
1532 _q_screenSaverWake();
1545 #ifndef QT_NO_QWS_KEYBOARD 1551 #if !defined(QT_NO_SOUND) && !defined(QT_EXTERNAL_SOUND_SERVER) && !defined(Q_OS_DARWIN) 1552 soundserver =
new QWSSoundServer(q);
1566 #ifndef QT_NO_QWS_KEYBOARD 1569 d_func()->cleanupFonts(
true);
1578 if (e->
timerId() ==
d->fontCleanupTimer.timerId()) {
1580 d->fontCleanupTimer.stop();
1597 if (w && mouseGrabber == w) {
1599 mouseGrabbing =
false;
1600 #ifndef QT_NO_QWS_CURSOR 1603 setCursor(nextCursor);
1626 if (mouseGrabber == w)
1633 #ifndef QT_NO_QWS_MULTIPROCESS 1640 while (
QWS_SOCK_BASE *sock = ssocket->nextPendingConnection()) {
1641 int socket = sock->socketDescriptor();
1645 clientMap[socket] = client;
1648 #ifdef QTRANSPORTAUTH_DEBUG 1649 qDebug(
"Transport auth connected: unix stream socket %d", socket );
1663 q,
SLOT(_q_doClient()));
1666 q,
SLOT(_q_clientClosed()));
1669 q,
SLOT(_q_doClient()));
1671 q,
SLOT(_q_clientClosed()));
1676 if (clientMap.contains(socket)) {
1680 for (
int i = 0; i < screens.
size(); ++i) {
1688 event.simpleData.screen = i;
1697 invokeCreate(&cmd, client);
1710 while (i < commandQueue.size()) {
1713 commandQueue.removeAt(i);
1726 for (
int i = 0; i < windows.size(); ++i) {
1735 while (i < windows.size()) {
1746 if (mouseGrabber == w)
1750 #ifndef QT_NO_QWS_PROPERTIES 1751 propertyManager.removeProperties(w->
winId());
1755 deletedWindows.append(w);
1760 if (deletedWindows.count())
1765 #if defined(QWS_DEBUG_FONTCLEANUP) 1770 crashedClientIds.append(cl->
clientId());
1771 fontCleanupTimer.start(10, q_func());
1777 #if defined(QWS_DEBUG_FONTCLEANUP) 1778 qDebug() <<
"dereferencing font" << font <<
"from disconnected client";
1780 dereferenceFont(clientPrivate, font);
1785 clientMap.remove(cl->
socket());
1786 if (cl == cursorClient)
1793 exposeRegion(exposed);
1799 deletedWindows.clear();
1802 #endif //QT_NO_QWS_MULTIPROCESS 1809 ++fontReferenceCount[font];
1810 #if defined(QWS_DEBUG_FONTCLEANUP) 1811 qDebug() <<
"Client" << client->q_func()->clientId() <<
"added font" << font;
1812 qDebug() <<
"Refcount is" << fontReferenceCount[font];
1822 Q_ASSERT(fontReferenceCount[font]);
1823 if (!--fontReferenceCount[font] && !fontCleanupTimer.isActive())
1824 fontCleanupTimer.start(FontCleanupInterval, q_func());
1826 #if defined(QWS_DEBUG_FONTCLEANUP) 1827 qDebug() <<
"Client" << client->q_func()->clientId() <<
"removed font" << font;
1828 qDebug() <<
"Refcount is" << fontReferenceCount[font];
1841 for (
uint i = 0; i < dir.
count(); ++i) {
1842 #if defined(QWS_DEBUG_FONTCLEANUP) 1843 qDebug() <<
"removing stale font file" << dir[i];
1855 #if defined(QWS_DEBUG_FONTCLEANUP) 1856 qDebug() <<
"cleanupFonts()";
1858 if (!fontReferenceCount.isEmpty()) {
1860 while (it != fontReferenceCount.
end()) {
1861 if (it.
value() && !force) {
1867 #if defined(QWS_DEBUG_FONTCLEANUP) 1868 qDebug() <<
"removing unused font file" << fontName;
1872 sendFontRemovedEvent(fontName);
1874 it = fontReferenceCount.
erase(it);
1883 if (crashedClientIds.isEmpty())
1887 #if !defined(QT_NO_QWS_QPF2) && !defined(QT_FONTS_ARE_RESOURCES) 1890 crashedClientIds.clear();
1892 for (
int i = 0; i < removedFonts.
count(); ++i)
1893 sendFontRemovedEvent(removedFonts.
at(i));
1904 (*it)->sendEvent(&event);
1912 #ifndef QT_NO_QWS_MULTIPROCESS 1916 if (socketDescriptor != -1)
1918 #if QTRANSPORTAUTH_DEBUG 1920 char displaybuf[1024];
1922 if ( bytes > 511 ) bytes = 511;
1923 hexstring( displaybuf, ((
unsigned char *)(reinterpret_cast<QAuthDevice*>(socket)->buffer().constData())), bytes );
1929 #ifndef QT_NO_QWS_MULTIPROCESS 1937 if (command_type >= 0)
1941 if (command->read(socket)) {
1952 #endif // QT_NO_QWS_MULTIPROCESS 1965 if (qwsServerPrivate)
1970 #ifndef QT_NO_QWS_MULTIPROCESS 1984 if (doClientIsActive) {
1985 pendingDoClients.append(client);
1988 doClientIsActive =
true;
1992 while (!pendingDoClients.isEmpty()) {
1993 doClient(pendingDoClients.takeFirst());
1996 doClientIsActive =
false;
1998 #endif // QT_NO_QWS_MULTIPROCESS 2006 commandQueue.append(cs);
2011 while (!commandQueue.isEmpty()) {
2020 #ifndef QT_NO_QWS_MULTIPROCESS 2022 cs->
client->d_func()->shutdown =
true;
2030 cs->
client->d_func()->unlockCommunication();
2034 cs->
client->d_func()->unlockCommunication();
2039 #ifndef QT_NO_QWS_PROPERTIES 2062 cs->
client->d_func()->unlockCommunication();
2069 #ifndef QT_NO_QWS_CURSOR 2086 #if !defined(QT_NO_SOUND) && !defined(Q_OS_DARWIN) 2100 #ifndef QT_NO_QWS_INPUTMETHODS 2123 cs->
client->d_func()->unlockCommunication();
2125 #ifndef QT_NO_QWSEMBEDWIDGET 2127 invokeEmbed(static_cast<QWSEmbedCommand*>(cs->
command),
2132 invokeScreenTransform(static_cast<QWSScreenTransformCommand*>(cs->
command),
2143 #ifndef QT_NO_QWS_CURSOR 2151 #ifndef QT_NO_QWS_CURSOR 2173 if (
d->disablePainting == !enable)
2176 d->disablePainting = !enable;
2181 for (
int i = 0; i <
d->windows.size(); ++i) {
2184 #ifdef QT_QWS_CLIENTBLIT 2185 w->setDirectPaintRegion(
QRegion());
2188 d->update_regions();
2194 for (
int i = 0; i <
d->windows.size(); ++i) {
2198 #ifdef QT_QWS_CLIENTBLIT 2200 QWSRegionEvent::DirectPaint);
2255 for (
int i = 0; i < subScreens.
size(); ++i) {
2256 const QScreen *screen = subScreens.
at(i);
2276 (*it)->sendMaxWindowRectEvent(rect);
2314 #ifndef QT_NO_QWS_CURSOR 2337 #ifdef EVENT_BLOCK_DEBUG 2338 qDebug() <<
"sendMouseEvent" << pos.
x() << pos.
y() << state << (block ?
"block" :
"pass");
2363 #ifndef QT_NO_QWS_INPUTMETHODS 2370 stroke_count = current_IM->
filter(tpos, state, wheel);
2373 if (stroke_count == 0) {
2385 #endif // end QT_NO_QWS_FSIM 2399 bool imMouse =
false;
2400 #ifndef QT_NO_QWS_INPUTMETHODS 2404 qwsServerPrivate->
focusw;
2406 imMouse = kbw == win;
2408 QWidget *target = winClient == serverClient ?
2419 winClient = win ? win->
client() : 0;
2421 event.simpleData.window = win ? win->
id : 0;
2423 #ifndef QT_NO_QWS_CURSOR 2446 if (!(state&btnMask))
2449 event.simpleData.x_root=pos.
x();
2450 event.simpleData.y_root=pos.
y();
2452 event.simpleData.delta = wheel;
2453 event.simpleData.time=qwsServerPrivate->
timer.
elapsed();
2457 #ifndef QT_NO_QWS_INPUTMETHODS 2466 if (winClient && winClient != serverClient)
2473 if (oldClient && oldClient != winClient && oldClient != serverClient) {
2481 qwsServer->d_func()->cursorClient = winClient;
2550 for (
int i=0; i < qwsServerPrivate->
windows.
size(); ++i) {
2574 event.simpleData.is_response = response;
2575 event.simpleData.lchannel = ch.
length();
2576 event.simpleData.lmessage = msg.
length();
2577 event.simpleData.ldata = data.
size();
2578 int l =
event.simpleData.lchannel +
event.simpleData.lmessage +
2579 event.simpleData.ldata;
2582 char *tmp =
new char [
l];
2585 d +=
event.simpleData.lchannel;
2587 d +=
event.simpleData.lmessage;
2588 memcpy(d, data.
constData(),
event.simpleData.ldata);
2590 event.setDataDirect(tmp, l);
2609 for (
int i=0; i<
d->windows.size(); ++i) {
2617 #ifndef QT_NO_QWS_KEYBOARD 2653 bool isPress,
bool autoRepeat)
2662 #ifndef QT_NO_QWS_INPUTMETHODS 2664 if (!current_IM || !current_IM->
filter(unicode, keycode, modifiers, isPress, autoRepeat))
2672 bool isPress,
bool autoRepeat)
2676 #ifndef QT_NO_QWS_KEYBOARD 2682 event.simpleData.window = win ? win->
winId() : 0;
2683 event.simpleData.unicode = unicode;
2684 event.simpleData.keycode =
keycode;
2685 event.simpleData.modifiers = modifiers;
2686 event.simpleData.is_press = isPress;
2687 event.simpleData.is_auto_repeat = autoRepeat;
2693 if (winClient && winClient != serverClient)
2703 #ifndef QT_NO_QWS_CURSOR 2721 #ifndef QT_NO_QWS_CURSOR 2733 qDebug(
"Desktop size: %dx%d",
qApp->desktop()->width(),
qApp->desktop()->height());
2738 #ifndef QT_NO_QWS_CURSOR 2747 #ifndef QT_NO_QWS_CURSOR 2763 if (qwsServerPrivate && qwsServerPrivate->
haveviscurs != vis) {
2780 return qwsServerPrivate ? qwsServerPrivate->
haveviscurs :
true;
2784 #ifndef QT_NO_QWS_INPUTMETHODS 2806 qwsServerPrivate->
focusw;
2810 if (current_IM_composing_win)
2813 event.simpleData.window = win ? win->
winId() : 0;
2825 for (
int i = 0; i < attributes.
count(); ++i) {
2829 event.setData(buffer.
data(), buffer.
size());
2833 if (win && win->
client() && win->
client() != serverClient)
2856 qwsServerPrivate->
focusw;
2857 if (current_IM_composing_win)
2860 event.simpleData.window = win ? win->
winId() : 0;
2861 event.simpleData.property =
property;
2862 if (win && win->
client())
2880 current_IM->
reset();
2890 #endif //QT_NO_QWS_INPUTMETHODS 2892 #ifndef QT_NO_QWS_PROPERTIES 2900 while (it !=
d->clientMap.end()) {
2911 #ifndef QT_NO_QWS_MULTIPROCESS 2921 event.simpleData.count = cmd->
count;
2938 #ifdef QWS_REGION_DEBUG 2939 qDebug(
"QWSServer::invokeRegion %d rects (%d)",
2949 qWarning(
"Disabled: clients changing other client's window region");
2966 qWarning(
"Disabled: clients changing other client's window region");
2984 qWarning(
"Disabled: clients changing other client's window region");
2988 setWindowRegion(changingw,
QRegion());
2990 for (
int i = 0; i < windows.size(); ++i) {
2991 if (windows.at(i) == changingw) {
2999 handleWindowClose(changingw);
3000 #ifndef QT_NO_QWS_PROPERTIES 3001 propertyManager.removeProperties(changingw->
winId());
3012 if (gain != 0 && gain != 1) {
3013 qWarning(
"Only 0(lose) and 1(gain) supported");
3017 QWSWindow* changingw = findWindow(winId, 0);
3022 qWarning(
"Disabled: clients changing other client's focus");
3026 setFocus(changingw, gain);
3032 #ifndef QT_NO_QWS_INPUTMETHODS 3043 QWSWindow *loser = (!gain == (focusw==changingw)) ? focusw : 0;
3049 if (focusw != changingw) {
3050 if (focusw) focusw->focus(0);
3055 }
else if (focusw == changingw) {
3057 changingw->
focus(0);
3061 for (
int i=0; i<windows.size(); ++i) {
3063 if (w != changingw && !w->
hidden() &&
3086 QWSWindow* changingw = findWindow(winId, 0);
3089 qWarning(
"invokeSetOpacity: Invalid window handle %d", winId);
3093 int altitude = windows.indexOf(changingw);
3094 const bool wasOpaque = changingw->
isOpaque();
3096 if (wasOpaque != changingw->
isOpaque())
3110 qDebug(
"QWSServer::invokeSetAltitude winId %d alt %d)", winId, alt);
3113 if (alt < -1 || alt > 1) {
3114 qWarning(
"QWSServer::invokeSetAltitude Only lower, raise and stays-on-top supported");
3118 QWSWindow* changingw = findWindow(winId, 0);
3120 qWarning(
"invokeSetAltitude: Invalid window handle %d", winId);
3124 if (fixed && alt >= 1) {
3125 changingw->
onTop =
true;
3137 #ifndef QT_NO_QWS_PROPERTIES 3153 #ifndef QT_NO_QWS_INPUTMETHODS 3156 emit q->markedText(s);
3175 return propertyManager.getProperty(winId, property, data, len);
3192 #endif //QT_NO_QWS_PROPERTIES 3196 qDebug(
"QWSServer::invokeSetSelectionOwner");
3203 if (selectionOwner.windowid != -1) {
3204 QWSWindow *win = findWindow(selectionOwner.windowid, 0);
3208 qDebug(
"couldn't find window %d", selectionOwner.windowid);
3211 selectionOwner = so;
3216 qDebug(
"QWSServer::invokeConvertSelection");
3218 if (selectionOwner.windowid != -1) {
3219 QWSWindow *win = findWindow(selectionOwner.windowid, 0);
3223 qDebug(
"couldn't find window %d", selectionOwner.windowid);
3227 #ifndef QT_NO_QWS_CURSOR 3231 qDebug(
"Cannot define cursor size > 64x64");
3239 if (dataLen > 0 && cmd->
data) {
3257 if (it != cursMap.
end()) {
3270 if (win != mouseGrabber)
3286 q->sendMouseEvent(newPos,
qwsServer->d_func()->mouseState);
3297 if (!mouseGrabber || mouseGrabber->client() == client) {
3298 mouseGrabbing =
true;
3302 releaseMouse(mouseGrabber);
3322 #if !defined(QT_NO_SOUND) 3325 #if !defined(QT_EXTERNAL_SOUND_SERVER) && !defined(Q_OS_DARWIN) 3326 soundserver->playFile( 1, cmd->
filename );
3349 #ifndef QT_NO_QWS_INPUTMETHODS 3353 current_IM->
reset();
3380 referenceFont(priv, cmd->
fontName);
3382 dereferenceFont(priv, cmd->
fontName);
3394 #ifndef QT_NO_QWSEMBEDWIDGET 3402 qWarning(
"QWSServer: Embed command from window %i failed: No such id.",
3408 qWarning(
"QWSServer: Embed command on window %i failed: No such id.",
3416 windows.removeAll(embedded);
3417 windows.insert(windows.indexOf(embedder), embedded);
3431 windows.indexOf(embedded));
3433 #endif // QT_NO_QWSEMBEDWIDGET 3446 (*it)->sendEvent(&event);
3457 for (
int i = nReserved; i < windows.size(); ++i) {
3460 windows.insert(i, w);
3473 for (
int i=0; i<windows.size(); ++i) {
3475 if (w->
winId() == windowid)
3479 return newWindow(windowid,client);
3487 if (changingw == windows.first())
3497 for (
int i = 0; i < windows.size(); ++i) {
3499 if (w == changingw) {
3508 bool onTop = changingw->
onTop;
3510 #ifndef QT_NO_QWSEMBEDWIDGET 3513 while (!onTop && embedder) {
3514 onTop = embedder->
onTop;
3521 windows.insert(nReserved, changingw);
3526 for (
int i = nReserved; i < windows.size(); ++i) {
3529 windows.insert(i, changingw);
3536 windows.append(changingw);
3537 newPos = windows.size()-1;
3541 if (windowPos != newPos) {
3544 exposeRegion(expose, newPos);
3553 if (changingw == windows.last())
3558 int i = windows.indexOf(changingw);
3559 int newIdx = windows.size()-1;
3560 windows.move(i, newIdx);
3569 for (
int j = i; j < windows.size() - 1; ++j)
3570 expose += (windows.at(j)->allocatedRegion() & bound);
3572 exposeRegion(expose, newIdx);
3581 if (disablePainting)
3588 const bool doLock = (clientMap.size() > 1);
3592 for (
int i = 0; i < windows.count(); ++i) {
3596 #ifndef QT_NO_QWSEMBEDWIDGET 3599 for (
int i = 0; i < n; ++i)
3605 #endif // QT_NO_QWSEMBEDWIDGET 3612 transparentRegion += r;
3615 r -= transparentRegion;
3625 #ifdef QT_QWS_CLIENTBLIT 3626 #ifdef QT_NO_QWS_CURSOR 3629 QRegion directPaint = (r - transparentRegion);
3630 if(directPaint != w->directPaintRegion()) {
3631 w->setDirectPaintRegion(directPaint);
3633 surface->setDirectRegion(directPaint, ++
id);
3635 QWSRegionEvent::DirectPaint, id);
3667 expose = oldRegion + newRegion;
3670 expose = oldRegion - newRegion;
3672 int idx = windows.indexOf(changingw);
3673 exposeRegion(expose, idx);
3674 changingw->
d->
state = oldState;
3684 qWarning(
"Not implemented in this release");
3696 int idx = windows.indexOf(changingw);
3697 exposeRegion(oldRegion - newRegion, idx);
3703 if (disablePainting)
3709 static bool initial =
true;
3729 d->mousehandlers.clear();
3744 #if defined(QT_QWS_CASSIOPEIA) 3749 mice = *defaultMouse();
3751 bool needviscurs =
true;
3754 for (
int i = mouse.
size() - 1; i >= 0; --i) {
3763 #ifndef QT_NO_QWS_CURSOR 3780 for (
int i=0; i <
d->mousehandlers.size(); ++i)
3781 d->mousehandlers.at(i)->suspend();
3793 for (
int i=0; i <
d->mousehandlers.size(); ++i)
3794 d->mousehandlers.at(i)->resume();
3805 mouseProto = spec.
left(c);
3806 mouseDev = spec.
mid(c+1);
3815 for (
int i = 0; i < regexps.
size(); ++i) {
3817 if (regexp.
indexIn(mouseDev) == -1)
3832 #ifndef QT_NO_QWS_KEYBOARD 3845 d->keyboardhandlers.clear();
3891 #if defined(QT_QWS_CASSIOPEIA) 3905 for (
int i = keyboard.
size() - 1; i >= 0; --i) {
3909 type = spec.
left(colon);
3910 device = spec.
mid(colon+1);
3920 #endif //QT_NO_QWS_KEYBOARD 3927 QWSClient *serverClient = clientMap.value(-1);
3928 invokeRegionMove(cmd, serverClient);
3933 QWSClient *serverClient = clientMap.value(-1);
3934 invokeSetAltitude(cmd, serverClient);
3939 QWSClient *serverClient = clientMap.value(-1);
3940 invokeSetOpacity(cmd, serverClient);
3946 invokeSetFocus(cmd, clientMap.value(-1));
3951 invokeIdentify(cmd, clientMap.value(-1));
3957 QWSWindow* changingw = findWindow(wid, 0);
3962 const bool isOpaque = changingw->
opaque;
3963 const bool wasPainted = changingw->
d->
painted;
3964 changingw->
opaque = opaque;
3968 if (isOpaque != opaque || !wasPainted)
3971 int level = windows.indexOf(changingw);
3972 exposeRegion(region, level);
3980 int oldPos = windows.indexOf(win);
3981 int newPos = oldPos < nReserved ? nReserved - 1 : nReserved;
3982 for (
int i = 0; i < nReserved; ++i) {
3988 windows.move(oldPos, newPos);
3989 nReserved = newPos + 1;
3998 QWSWindow *changingw = findWindow(wid, 0);
4010 const bool wasOpaque = changingw->
opaque;
4024 r = reserve_region(changingw, region);
4034 changingw->
d->
state = windowState;
4040 setWindowRegion(changingw, r);
4049 surface->QWindowSurface::setGeometry(r.
boundingRect());
4056 handleWindowClose(changingw);
4066 invokeRegionDestroy(cmd, clientMap.value(-1));
4071 invokeRegionName(cmd, clientMap.value(-1));
4074 #ifndef QT_NO_QWS_INPUTMETHODS 4077 invokeIMResponse(cmd, clientMap.value(-1));
4082 invokeIMUpdate(cmd, clientMap.value(-1));
4128 if (!QWSServerPrivate::bgBrush)
4129 QWSServerPrivate::bgBrush =
new QBrush(brush);
4131 *QWSServerPrivate::bgBrush = brush;
4158 void QWSServer::setDesktopBackground(
const QImage &img)
4186 void QWSServer::setDesktopBackground(
const QColor &
c)
4190 #endif //QT3_SUPPORT 4213 }
QT_CATCH(
const std::bad_alloc &) {
4221 #ifndef QT_NO_QWS_KEYBOARD 4227 #ifndef QT_NO_QWS_KEYBOARD 4249 bool isPress,
bool autoRepeat)
4258 #ifdef EVENT_BLOCK_DEBUG 4259 qDebug() <<
"processKeyEvent" << unicode << keycode << modifiers << isPress << autoRepeat << (block ?
"block" :
"pass");
4270 for (
int i = 0; i < keyFilters->
size(); ++i) {
4272 if (keyFilter->
filter(unicode, keycode, modifiers, isPress, autoRepeat))
4276 sendKeyEvent(unicode, keycode, modifiers, isPress, autoRepeat);
4325 if (!keyFilters || keyFilters->
isEmpty())
4327 delete keyFilters->
takeAt(0);
4329 #endif // QT_NO_QWS_KEYBOARD 4352 if (!qwsServerPrivate)
4419 if (!qwsServerPrivate)
4422 #ifdef EVENT_BLOCK_DEBUG 4423 qDebug() <<
"QWSServer::setScreenSaverBlockLevel() " << eventBlockLevel;
4431 if (screensaverintervals) {
4432 if (screensaverinterval != screensaverintervals) {
4433 if (saver) saver->restore();
4434 screensaverinterval = screensaverintervals;
4435 screensaverblockevents =
false;
4437 if (!screensavertimer->isActive()) {
4439 if (saver) saver->restore();
4442 screensavertimer->start(*screensaverinterval);
4443 screensavertime.start();
4451 #if !defined(QT_QWS_IPAQ) && !defined(QT_QWS_EBX) 4452 screensavertimer->stop();
4454 if (screensaverinterval) {
4455 screensavertimer->start(*screensaverinterval);
4456 screensavertime.start();
4458 screensavertimer->stop();
4486 bool oldScreensaverblockevents = screensaverblockevents;
4487 if (*screensaverinterval >= 1000) {
4488 screensaverblockevents = (screensavereventblocklevel >= 0 && screensavereventblocklevel <= level);
4489 #ifdef EVENT_BLOCK_DEBUG 4490 if (screensaverblockevents)
4491 qDebug(
"ready to block events");
4494 int *oldScreensaverinterval = screensaverinterval;
4495 if (saver->save(level)) {
4497 if (oldScreensaverinterval == screensaverinterval) {
4498 if (screensaverinterval && screensaverinterval[1]) {
4499 screensavertimer->start(*++screensaverinterval);
4500 screensavertime.start();
4502 screensaverinterval = 0;
4507 screensaverblockevents = oldScreensaverblockevents;
4511 if (screensaverinterval && *screensaverinterval) {
4512 screensavertimer->start(*screensaverinterval);
4513 screensavertime.start();
4517 screensaverinterval = 0;
4518 screensaverblockevents =
false;
4519 _q_screenSaverSleep();
4525 if (screensaverinterval) {
4526 if (screensavertime.elapsed() > *screensaverinterval*2) {
4528 _q_screenSaverWake();
4531 screenSave(screensaverinterval - screensaverintervals);
4583 if (winClient && winClient != cursorClient)
4584 q->sendMouseEvent(QWSServer::mousePosition, mouseState);
4587 #ifndef QT_NO_QWS_INPUTMETHODS 4682 if (current_IM ==
this)
4746 if (current_IM_composing_win) {
4872 int selPos = cursorPosition;
4873 if (selectionLength == 0) {
4875 }
else if (selectionLength < 0) {
4876 selPos += selectionLength;
4877 selectionLength = -selectionLength;
4883 if (selectionLength)
4887 if (selPos + selectionLength < preeditString.
length())
4889 selPos + selectionLength,
4890 preeditString.
length() - selPos - selectionLength,
4992 mIResolution = isHigh;
4993 return inputResolutionShift();
5031 QWSServer::mousePosition = pos;
5035 #endif // QT_NO_QWS_INPUTMETHODS 5124 #include "moc_qwindowsystem_qws.cpp" The QVariant class acts like a union for the most common Qt data types.
void invokeIMUpdate(const QWSIMUpdateCommand *cmd, QWSClient *client)
void setAllocatedRegion(const QRegion ®ion)
The QDir class provides access to directory structures and their contents.
Q_GUI_EXPORT QScreen * qt_screen
struct QWSAddPropertyCommand::SimpleData simpleData
#define QT_QWS_PROPERTY_MARKEDTEXT
void sendEvent(QWSEvent *event)
struct QWSRepaintRegionCommand::SimpleData simpleData
The QColor class provides colors based on RGB, HSV or CMYK values.
void show()
Shows the window.
struct QWSIMResponseCommand::SimpleData simpleData
void setWindowRegion(QWSWindow *, const QRegion &r)
Changes the requested region of window changingw to r If changingw is 0, the server's reserved region...
The QWSWindowSurface class provides the drawing area for top-level windows in Qt for Embedded Linux...
virtual void move(int x, int y)
Moves the mouse cursor to the given position, i.e., (x, y).
static QPixmap fromImage(const QImage &image, Qt::ImageConversionFlags flags=Qt::AutoColor)
Converts the given image to a pixmap using the specified flags to control the conversion.
The QWSKeyboardHandler class is a base class for keyboard drivers in Qt for Embedded Linux...
void setMaxWindowRect(const QScreen *screen, int screenNo, const QRect &rect)
void set_altitude(const QWSChangeAltitudeCommand *)
QRect maxWindowRect(const QScreen *screen) const
Q_CORE_EXPORT QByteArray qgetenv(const char *varName)
void invokeRegionMove(const QWSRegionMoveCommand *cmd, QWSClient *client)
void invokeGetProperty(QWSGetPropertyCommand *cmd, QWSClient *client)
The KeyboardFilter class is a base class for global keyboard event filters in Qt for Embedded Linux...
int height() const
Returns the logical height of the framebuffer in pixels.
#define QT_NO_QWSEMBEDWIDGET
static void sendMouseEvent(const QPoint &pos, int state, int wheel=0)
Send a mouse event.
void invokeAddProperty(QWSAddPropertyCommand *cmd)
struct QWSRegionMoveCommand::SimpleData simpleData
QString cap(int nth=0) const
Returns the text captured by the nth subexpression.
#define QT_END_NAMESPACE
This macro expands to.
const Key key(const T &value) const
Returns the first key with value value.
static QString fromAscii(const char *, int size=-1)
Returns a QString initialized with the first size characters from the string str. ...
QWSWindowSurface * surface
char * data()
Returns a pointer to the data stored in the byte array.
const QByteArray & data() const
Returns the data contained in the buffer.
static void sendQCopEvent(QWSClient *c, const QString &ch, const QString &msg, const QByteArray &data, bool response=false)
The QRegExp class provides pattern matching using regular expressions.
bool inputMethodMouseGrabbed
int toInt(bool *ok=0, int base=10) const
Returns the string converted to an int using base base, which is 10 by default and must be between 2 ...
void refresh()
Refreshes the display by making the screen driver update the entire display.
static QWSCommand * factory(int type)
#define it(className, varName)
The QFlag class is a helper data type for QFlags.
static void setDefaultMouse(const char *)
Sets the mouse driver that will be used if the QWS_MOUSE_PROTO environment variable is not defined...
static QWSCursor * systemCursor(int id)
bool open(OpenMode openMode)
Reimplemented Function
void invokeRemoveProperty(QWSRemovePropertyCommand *cmd)
QTransportAuth::Data * connectTransport(unsigned char, int)
Record a new transport connection with properties and descriptor.
void invokeIMResponse(const QWSIMResponseCommand *cmd, QWSClient *client)
struct QWSPositionCursorCommand::SimpleData simpleData
void removeUnbufferedSurface()
bool isNull() const
Returns true if it is a null image, otherwise returns false.
bool remove(const T &value)
The QByteArray class provides an array of bytes.
Q_CORE_EXPORT QTextStream & reset(QTextStream &s)
The QWSMouseHandler class is a base class for mouse drivers in Qt for Embedded Linux.
int length() const
Returns the number of characters in this string.
void invokeGrabMouse(QWSGrabMouseCommand *cmd, QWSClient *client)
State
This enum describes the state of a window.
bool empty() const
This function is provided for STL compatibility.
QWSClient * client() const
Returns a reference to the QWSClient object that owns this window.
virtual bool connect(const QString &displaySpec)=0
This function is called by every Qt for Embedded Linux application on startup, and must be implemente...
void setIdentity(const QString &)
virtual void timerEvent(QTimerEvent *)
This event handler can be reimplemented in a subclass to receive timer events for the object...
void sendPropertyNotifyEvent(int property, int state)
static qreal position(QGraphicsObject *item, QDeclarativeAnchorLine::AnchorLine anchorLine)
static int current_IM_winId
QSet< QByteArray > usedFonts
QList< QWSCommand * > * qt_get_server_queue()
Pass-through QIODevice sub-class for authentication.
int pos(int nth=0) const
Returns the position of the nth captured text in the searched string.
int matchedLength() const
Returns the length of the last matched string, or -1 if there was no match.
int qws_read_uint(QIODevice *socket)
QString qws_fontCacheDir()
qint64 size() const
Reimplemented Function
struct QWSRequestFocusCommand::SimpleData simpleData
static QApplicationPrivate * instance()
int deviceWidth() const
Returns the physical width of the framebuffer device in pixels.
The QWSScreenSaver class is a base class for screensavers in Qt for Embedded Linux.
void referenceFont(QWSClientPrivate *client, const QByteArray &font)
long ASN1_INTEGER_get ASN1_INTEGER * a
Q_GLOBAL_STATIC_WITH_ARGS(QString, defaultMouse,(QLatin1String("Auto"))) Q_GLOBAL_STATIC_WITH_ARGS(QString
int count(const T &t) const
Returns the number of occurrences of value in the list.
virtual QSize mapFromDevice(const QSize &) const
Maps the given size from the framebuffer coordinate system to the coordinate space used by the applic...
QRect boundingRect() const
Returns the bounding rectangle of this region.
void raise()
Raises the window above all other windows except "Stay on top" windows.
void im_response(const QWSIMResponseCommand *)
bool qt_disable_lowpriority_timers
iterator find(const Key &key)
Returns an iterator pointing to the item with key key in the map.
QRegion allocatedRegion() const
Returns the region that the window is allowed to draw onto, including any window decorations but excl...
bool isBuffered() const
Returns true if the QWSWindowSurface::Buffered is set; otherwise returns false.
void disconnectClient(QWSClient *)
static ClearCacheFunc clearCacheFunc
The QBuffer class provides a QIODevice interface for a QByteArray.
static void setCursorVisible(bool)
Shows the cursor if visible is true: otherwise the cursor is hidden.
The QString class provides a Unicode character string.
static bool screenSaverActive()
Returns true if the screen saver is active; otherwise returns false.
T * qobject_cast(QObject *object)
static void sendMouseEventUnfiltered(const QPoint &pos, int state, int wheel=0)
uint count() const
Returns the total number of directories and files in the directory.
static void screenSaverActivate(bool)
Activates the screen saver if activate is true; otherwise it is deactivated.
struct QWSIMMouseCommand::SimpleData simpleData
void invokeDefineCursor(QWSDefineCursorCommand *cmd, QWSClient *client)
void updateWindowRegions() const
QWSCommand * readMoreCommand()
void exposeRegion(const QRegion &, int index=0)
The QObject class is the base class of all Qt objects.
virtual bool event(QEvent *)
This virtual function receives events to an object and should return true if the event e was recogniz...
struct QWSSetPropertyCommand::SimpleData simpleData
void sendSelectionClearEvent(int windowid)
void sendPropertyReplyEvent(int property, int len, const char *data)
struct QWSSetSelectionOwnerCommand::SimpleData simpleData
void closeMouse()
Closes all pointer devices (specified by the QWS_MOUSE_PROTO environment variable) by deleting the as...
void im_update(const QWSIMUpdateCommand *)
The QChar class provides a 16-bit Unicode character.
void createSurface(const QString &key, const QByteArray &data)
static void setScreenSaverBlockLevel(int)
Block the key or mouse event that wakes the system from level eventBlockLevel or higher.
static void processKeyEvent(int unicode, int keycode, Qt::KeyboardModifiers modifiers, bool isPress, bool autoRepeat)
Processes the given key event.
void sendSelectionRequestEvent(QWSConvertSelectionCommand *cmd, int windowid)
void invokeEmbed(QWSEmbedCommand *cmd, QWSClient *client)
static QWSInputMethod * current_IM
static void processEventQueue()
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
static void removeKeyboardFilter()
Removes and deletes the most recently added filter.
The QScopedPointer class stores a pointer to a dynamically allocated object, and deletes it upon dest...
void invokeSetSelectionOwner(QWSSetSelectionOwnerCommand *cmd)
QObject * sender() const
Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; othe...
void setObjectName(const QString &name)
int numUnbufferedSurfaces
void closeKeyboard()
Closes all the keyboard devices (specified by the QWS_KEYBOARD environment variable) by deleting the ...
Q_CORE_EXPORT QTextStream & fixed(QTextStream &s)
The QWSEvent class encapsulates an event in Qt for Embedded Linux.
static QString decodeName(const QByteArray &localFileName)
This does the reverse of QFile::encodeName() using localFileName.
void set(int h, int m, int s, int s2)
T & value() const
Returns a modifiable reference to the current item's value.
struct QWSRegionDestroyCommand::SimpleData simpleData
bool screensaverblockevent(int index, int *screensaverinterval, bool isDown)
struct QWSSetOpacityCommand::SimpleData simpleData
SocketState
This enum describes the different states in which a socket can be.
static const QRectF boundingRect(const QPointF *points, int pointCount)
Q_CORE_EXPORT void qDebug(const char *,...)
The QWSWindow class encapsulates a top-level window in Qt for Embedded Linux.
static QWidget * widgetAt(const QPoint &p)
Returns the widget at global screen position point, or 0 if there is no Qt widget there...
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.
struct QWSChangeAltitudeCommand::SimpleData simpleData
static void beginDisplayReconfigure()
virtual QRegion region() const
Returns the region covered by this screen driver.
void openKeyboard()
Opens the keyboard devices specified by the QWS_KEYBOARD environment variable.
void cleanupFonts(bool force=false)
int width() const
Returns the logical width of the framebuffer in pixels.
void hide()
Hides the window.
static int keyUnicode(int keycode)
void append(const T &t)
Inserts value at the end of the list.
void moveWindowRegion(QWSWindow *, int dx, int dy)
static bool keyboardGrabbing
QList< QWSMouseHandler * > mousehandlers
void invokeRegion(QWSRegionCommand *cmd, QWSClient *client)
void setName(const QString &n)
QLatin1String("TTY"))) static const int FontCleanupInterval
#define QT_BEGIN_NAMESPACE
This macro expands to.
void invokeRegionDestroy(const QWSRegionDestroyCommand *cmd, QWSClient *client)
void invokeRegisterChannel(QWSQCopRegisterChannelCommand *cmd, QWSClient *client)
void timerEvent(QTimerEvent *e)
int indexIn(const QString &str, int offset=0, CaretMode caretMode=CaretAtZero) const
Attempts to find a match in str from position offset (0 by default).
static void setBackground(const QBrush &)
Sets the brush used as background in the absence of obscuring windows, to be the given brush...
void invokeRegionName(const QWSRegionNameCommand *cmd, QWSClient *client)
QString left(int n) const Q_REQUIRED_RESULT
Returns a substring that contains the n leftmost characters of the string.
void enablePainting(bool)
Enables painting onto the screen if enable is true; otherwise painting is disabled.
QWSWindow * newWindow(int id, QWSClient *client)
int * screensaverinterval
bool contains(const T &value) const
T takeFirst()
Removes the first item in the list and returns it.
static void sendKeyEvent(int unicode, int keycode, Qt::KeyboardModifiers modifiers, bool isPress, bool autoRepeat)
Sends the given key event.
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 rece...
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
static void setScreenSaver(QWSScreenSaver *)
Installs the given screenSaver, deleting the current screen saver.
bool isEmpty() const
Returns true if the region is empty; otherwise returns false.
Qt::WindowFlags windowFlags
QWSWindow * findWindow(int windowid, QWSClient *client=0)
void resumeMouse()
Resumes pointer handling by reactivating all the mouse drivers registered by the QWS_MOUSE_PROTO envi...
static QWSKeyboardHandler * create(const QString &, const QString &)
QWSWindow(int i, QWSClient *client)
void sendEmbedEvent(int winid, QWSEmbedEvent::Type type, const QRegion ®ion=QRegion())
static void setCurrentInputMethod(QWSInputMethod *im)
Sets the current input method to be the given method.
void move_region(const QWSRegionMoveCommand *)
const T value(const Key &key) const
Returns the value associated with the key key.
void invokeSetOpacity(const QWSSetOpacityCommand *cmd, QWSClient *client)
void prepend(const T &t)
Inserts value at the beginning of the list.
void sendMaxWindowRectEvents(const QRect &rect)
const T & at(int i) const
Returns the item at index position i in the list.
The QStringList class provides a list of strings.
SocketError
This enum describes the socket errors that can occur.
static bool isCursorVisible()
Returns true if the cursor is visible; otherwise returns false.
void handleWindowClose(QWSWindow *w)
void set_identity(const QWSIdentifyCommand *)
void qt_qws_init_fontdb()
void lowerWindow(QWSWindow *, int=-1)
Qt::WindowFlags windowFlags() const
Returns the window flags of the window.
The QResizeEvent class contains event parameters for resize events.
Q_CORE_EXPORT void qWarning(const char *,...)
const_iterator insert(const T &value)
int timerId() const
Returns the unique timer identifier, which is the same identifier as returned from QObject::startTime...
The QImage class provides a hardware-independent image representation that allows direct access to th...
static QList< QByteArray > cleanUpAfterClientCrash(const QList< int > &crashedClientIds)
void sendIMQuery(int property)
Sends an input method query for the given property.
bool contains(const QPoint &p) const
Returns true if the region contains the point p; otherwise returns false.
static const char * data(const QByteArray &arr)
QString qws_qtePipeFilename()
int indexOf(QChar c, int from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
struct QWSSelectCursorCommand::SimpleData simpleData
QTimer * screensavertimer
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
bool isActive() const
Returns true if the timer is running (pending); otherwise returns false.
void sendMaxWindowRectEvent(const QRect &rect)
static QScreen * instance()
Returns a pointer to the application's QScreen instance.
static void answer(QWSClient *cl, const QString &ch, const QString &msg, const QByteArray &data)
Server side: transmit the message to all clients registered to the specified channel.
void invokeConvertSelection(QWSConvertSelectionCommand *cmd)
void setActiveWindow()
Make this the active window (i.
The QRegion class specifies a clip region for a painter.
void raiseWindow(QWSWindow *, int=0)
QByteArray toLatin1() const Q_REQUIRED_RESULT
Returns a Latin-1 representation of the string as a QByteArray.
struct QWSRegionNameCommand::SimpleData simpleData
QAuthDevice * recvBuf(QTransportAuth::Data *, QIODevice *)
Return a QIODevice pointer (to an internal QBuffer) which can be used to receive data after authoriza...
static int qws_keyModifiers
struct QWSEmbedCommand::@168 simpleData
int focusPriority() const
void request_focus(const QWSRequestFocusCommand *)
static void cleanupFontsDir()
static void startup(int flags)
void releaseMouse(QWSWindow *w)
QWSWindow * windowAt(const QPoint &pos)
Returns the window containing the given position.
void invokePositionCursor(QWSPositionCursorCommand *cmd, QWSClient *client)
void invokeCreate(QWSCreateCommand *cmd, QWSClient *client)
static void detach(QWSClient *cl)
Server side: unsubscribe cl from all channels.
void startEmbed(QWSWindow *window)
void _q_screenSaverSleep()
static QWSMouseHandler * create(const QString &, const QString &)
static QWSServerPrivate * qwsServerPrivate
QWSCommandStruct(QWSCommand *c, QWSClient *cl)
static void setDefaultKeyboard(const char *)
Sets the keyboard driver that will be used if the QWS_KEYBOARD environment variable is not defined...
QList< QWSKeyboardHandler * > keyboardhandlers
void invokeGrabKeyboard(QWSGrabKeyboardCommand *cmd, QWSClient *client)
void invokeQCopSend(QWSQCopSendCommand *cmd, QWSClient *client)
virtual void hide()
Hides the cursor from the screen.
QList< QWSWindow * > embedded
void suspendMouse()
Suspends pointer handling by deactivating all the mouse drivers registered by the QWS_MOUSE_PROTO env...
void sendRegionEvent(int winid, QRegion rgn, int type)
virtual QWSWindowSurface * createSurface(QWidget *widget) const
Creates and returns a new window surface for the given widget.
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...
int length() const
Same as size().
T & first()
Returns a reference to the first item in the list.
const char * constData() const
Returns a pointer to the data stored in the byte array.
void sendIMEvent(const QInputMethodEvent *)
Sends the given input method event.
bool isEmpty() const
Returns true if the rectangle is empty, otherwise returns false.
static void setScreenSaverIntervals(int *ms)
Specifies the time intervals (in milliseconds) between the different levels of screen responsiveness...
bool isVisible() const
Returns true if the window is visible; otherwise returns false.
The QBrush class defines the fill pattern of shapes drawn by QPainter.
QRegion reserve_region(QWSWindow *window, const QRegion ®ion)
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...
static QWSKeyboardHandler * keyboardHandler()
Returns the primary keyboard driver.
int elapsed() const
Returns the number of milliseconds that have elapsed since the last time start() or restart() was cal...
void invokeSelectCursor(QWSSelectCursorCommand *cmd, QWSClient *client)
void addUnbufferedSurface()
void sendPropertyNotifyEvent(int property, int state)
void name_region(const QWSRegionNameCommand *)
static QAuServer & server()
void invokePlaySound(QWSPlaySoundCommand *cmd, QWSClient *client)
Q_CORE_EXPORT void qFatal(const char *,...)
void dereferenceFont(QWSClientPrivate *client, const QByteArray &font)
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary item after the last item in the map...
~QWSServer()
Destructs this server.
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.
virtual void blank(bool on)
Prevents the screen driver form displaying any content on the screen.
int winId() const
Returns the window's ID.
#define Q_DECLARE_PUBLIC(Class)
void setRects(const QRect *rect, int num)
Sets the region using the array of rectangles specified by rects and number.
void invokeFont(const QWSFontCommand *cmd, QWSClient *client)
void releaseKeyboard(QWSWindow *w)
static void addKeyboardFilter(KeyboardFilter *f)
Activates the given keyboard filter all key events generated by physical keyboard drivers (i...
QByteArray qws_display_spec
virtual ~QWSScreenSaver()
Reimplement this function to destroy the screensaver.
void doClient(QWSClient *)
void initServer(int flags)
State state() const
Returns the current state of the window.
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.
static const QList< QWSMouseHandler * > & mouseHandlers()
Returns list of all mouse handlers.
The QTimerEvent class contains parameters that describe a timer event.
static void setKeyboardHandler(QWSKeyboardHandler *kh)
Sets the primary keyboard driver to be the given driver.
QRegion dirtyOnScreen() const
Returns the region that has been repainted since the previous QScreen::exposeRegion(), and needs to be copied to the screen.
int deviceHeight() const
Returns the full height of the framebuffer device in pixels.
const QBrush & backgroundBrush() const
Returns the brush used as background in the absence of obscuring windows.
iterator end()
Returns an STL-style iterator pointing to the imaginary item after the last item in the map...
bool isOpaque() const
Returns true if the QWSWindowSurface::Opaque is set; otherwise returns false.
void set_opacity(const QWSSetOpacityCommand *)
void invokeSetProperty(QWSSetPropertyCommand *cmd)
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
void invokeSetFocus(const QWSRequestFocusCommand *cmd, QWSClient *client)
int * screensaverintervals
void _q_screenSaverTimeout()
int clientId() const
Returns an integer uniquely identfying this client.
void unlockCommunication()
iterator insert(const Key &key, const T &value)
Inserts a new item with the key key and a value of value.
Q_INVOKABLE QObject(QObject *parent=0)
Constructs an object with parent object parent.
QObject * parent() const
Returns a pointer to the parent object.
QList< QWSWindow * > windows
virtual QList< QScreen * > subScreens() const
virtual bool isTransformed() const
Returns true if the screen is transformed (for instance, rotated 90 degrees); otherwise returns false...
struct QWSDefineCursorCommand::SimpleData simpleData
The QPoint class defines a point in the plane using integer precision.
bool singleShot
This static function calls a slot after a given time interval.
bool isRegionReserved() const
Returns true if the QWSWindowSurface::RegionReserved is set; otherwise returns false.
static void ignoreSignal(int)
void qt_client_enqueue(const QWSEvent *)
int size() const
Returns the number of items in the list.
static QList< QWSInternalWindowInfo * > * windowList()
struct QWSServerPrivate::SelectionOwner::Time time
virtual qint64 bytesAvailable() const
Returns the number of bytes that are available for reading.
static QWSWindow * current_IM_composing_win
void invokeIdentify(const QWSIdentifyCommand *cmd, QWSClient *client)
static int global_focus_time_counter
The QRect class defines a rectangle in the plane using integer precision.
void setClient(QObject *)
QWSWindowSurface * windowSurface() const
void sendFontRemovedEvent(const QByteArray &font)
struct QWSGrabMouseCommand::SimpleData simpleData
The QScreen class is a base class for screen drivers in Qt for Embedded Linux.
virtual void shutdownDevice()
This function is called by the Qt for Embedded Linux server before it calls the disconnect() function...
T takeAt(int i)
Removes the item at index position i and returns it.
void destroy_region(const QWSRegionDestroyCommand *)
int size() const
Returns the number of bytes in this byte array.
int y() const
Returns the y coordinate of this point.
static void resetInputMethod()
bool remove()
Removes the file specified by fileName().
void screenSave(int level)
virtual int transformOrientation() const
Returns the current rotation as an integer value.
QVariant property(const char *name) const
Returns the value of the object's name property.
static void setScreenSaverInterval(int)
Sets the timeout interval for the screensaver to the specified milliseconds.
static QPoint mousePosition
static QWSWindow * keyboardGrabber
void repaint_region(int winId, int windowFlags, bool opaque, const QRegion &)
static void endDisplayReconfigure()
void lower()
Lowers the window below other windows.
void stopEmbed(QWSWindow *window)
void invokeSetAltitude(const QWSChangeAltitudeCommand *cmd, QWSClient *client)
iterator erase(iterator it)
Removes the (key, value) pair pointed to by the iterator pos from the map, and returns an iterator to...
bool get_property(int winId, int property, const char *&data, int &len)
const QString & caption() const
Returns the window's caption.
void updateClientCursorPos()
void operation(QWSWindowOperationEvent::Operation o)
void sendConnectedEvent(const char *display_spec)
void translate(int dx, int dy)
Translates (moves) the region dx along the X axis and dy along the Y axis.
bool remove(const QString &fileName)
Removes the file, fileName.
T take(const Key &key)
Removes the item with the key key from the map and returns the value associated with it...
struct QWSConvertSelectionCommand::SimpleData simpleData
bool isEmpty() const
Returns true if the byte array has size 0; otherwise returns false.
The QSize class defines the size of a two-dimensional object using integer point precision.
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...
Authenticate a message transport.
The QDataStream class provides serialization of binary data to a QIODevice.
virtual void setPermanentState(const QByteArray &state)
Implement this function to attach a server-side surface instance to the corresponding client side ins...
const QString & name() const
Returns the window's name, which is taken from the QWidget::objectName() at the time of QWidget::show...
QWSMouseHandler * newMouseHandler(const QString &spec)
int x() const
Returns the x coordinate of this point.
struct QWSFontCommand::SimpleData simpleData
static void emergency_cleanup()
Q_GUI_EXPORT QScreenCursor * qt_screencursor
static void registerChannel(const QString &ch, QWSClient *cl)
Server side: subscribe client cl on channel ch.
The QTimer class provides repetitive and single-shot timers.
struct QWSGrabKeyboardCommand::SimpleData simpleData
QWSServer(int flags=0, QObject *parent=0)
QString & remove(int i, int len)
Removes n characters from the string, starting at the given position index, and returns a reference t...
bool isOpaque() const
Returns true if the window is opaque, i.
virtual void exposeRegion(QRegion r, int changing)
This function is called by the Qt for Embedded Linux server whenever a screen update is required...
struct QWSIdentifyCommand::SimpleData simpleData
QImageIOHandler * handler
bool forClient(const QWSClient *cl) const
The QIODevice class is the base interface class of all I/O devices in Qt.
static int get_object_id(int count=1)
QIODevice * passThroughByClient(QWSClient *) const
virtual void show()
Shows the mouse cursor.
void stop()
Stops the timer.
struct QWSRemovePropertyCommand::SimpleData simpleData
int screensavereventblocklevel
static bool force_reject_strokeIM
void openMouse()
Opens the mouse devices specified by the QWS_MOUSE_PROTO environment variable.
QWSClient(QObject *parent, QWS_SOCK_BASE *, int id)
void invokeRepaintRegion(QWSRepaintRegionCommand *cmd, QWSClient *client)
QRegion paintedRegion() const
Returns the region that the window is known to have drawn into.
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Q_OUTOFLINE_TEMPLATE void qDeleteAll(ForwardIterator begin, ForwardIterator end)
The QWSClient class encapsulates a client process in Qt for Embedded Linux.
void _q_deleteWindowsLater()
void deleteLater()
Schedules this object for deletion.
void _q_screenSaverWake()
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
struct QWSGetPropertyCommand::SimpleData simpleData
void setCaption(const QString &c)
Sets the window's caption to c.
static void sendKeyEventUnfiltered(int unicode, int keycode, Qt::KeyboardModifiers modifiers, bool isPress, bool autoRepeat)
struct QWSIMUpdateCommand::SimpleData simpleData
void setFocus(QWSWindow *, bool gain)
static void setMouseHandler(QWSMouseHandler *)
Sets the primary mouse driver to be the given driver.
struct QWSRegionCommand::SimpleData simpleData
The QMap class is a template class that provides a skip-list-based dictionary.
static QList< QWSServer::KeyboardFilter * > * keyFilters
QWSServer Q_GUI_EXPORT * qwsServer
static QTransportAuth * getInstance()
Return a pointer to the instance of this process's QTransportAuth object.
void request_region(int winId, const QString &surfaceKey, const QByteArray &surfaceData, const QRegion ®ion)
void setScreen(const QScreen *screen)
Sets the screen for this mouse driver to be the given screen.
const QList< QWSWindow * > & clientWindows()
Returns the list of current top-level windows.
The QList class is a template class that provides lists.
static Qt::KeyboardModifiers oldstate
void send_im_mouse(const QWSIMMouseCommand *)
void setCursor(QWSCursor *curs)
int removeAll(const T &t)
Removes all occurrences of value in the list and returns the number of entries removed.
struct QWSConnectedEvent::SimpleData simpleData
void invokeScreenTransform(const QWSScreenTransformCommand *cmd, QWSClient *client)
static QWSMouseHandler * mouseHandler()
Returns the primary mouse driver.