Qt 4.8
Classes | Public Functions | Static Public Functions | Properties | Static Private Attributes | Friends | List of all members
QWSDisplay Class Reference

The QWSDisplay class provides a display for QWS; it is an internal class. More...

#include <qwsdisplay_qws.h>

Classes

class  Data
 

Public Functions

void addProperty (int winId, int property)
 
void convertSelection (int winId, int selectionProperty, const QString &mimeTypes)
 
void defineCursor (int id, const QBitmap &curs, const QBitmap &mask, int hotX, int hotY)
 
int depth () const
 
void destroyCursor (int id)
 
void destroyRegion (int winId)
 
bool eventPending () const
 
void flushCommands ()
 
ucharframeBuffer () const
 
QWSEventgetEvent ()
 
bool getProperty (int winId, int property, char *&data, int &len)
 
void grabKeyboard (QWidget *w, bool grab)
 
void grabMouse (QWidget *w, bool grab)
 
int height () const
 
void moveRegion (int winId, int dx, int dy)
 
void nameRegion (int winId, const QString &n, const QString &c)
 
int pixmapDepth () const
 
void playSoundFile (const QString &)
 
 QWSDisplay ()
 
void registerChannel (const QString &channel)
 
void removeProperty (int winId, int property)
 
void repaintRegion (int winId, int windowFlags, bool opaque, QRegion)
 
void requestFocus (int winId, bool get)
 
void requestRegion (int winId, const QString &surfacekey, const QByteArray &surfaceData, const QRegion &region)
 
void resetIM ()
 
void selectCursor (QWidget *w, unsigned int id)
 
void sendFontCommand (int type, const QByteArray &fontName)
 
void sendIMMouseEvent (int index, bool isPress)
 
void sendIMResponse (int winId, int property, const QVariant &result)
 
void sendIMUpdate (int type, int winId, int widgetid)
 
void sendMessage (const QString &channel, const QString &msg, const QByteArray &data)
 
void setAltitude (int winId, int altitude, bool fixed=false)
 
void setCursorPosition (int x, int y)
 
void setIdentity (const QString &appName)
 
void setOpacity (int winId, int opacity)
 
void setProperty (int winId, int property, int mode, const QByteArray &data)
 
void setProperty (int winId, int property, int mode, const char *data)
 
void setSelectionOwner (int winId, const QTime &time)
 
void setWindowCaption (QWidget *w, const QString &)
 
ucharsharedRam () const
 
int sharedRamSize () const
 
bool supportsDepth (int) const
 
int takeId ()
 
QWSQCopMessageEventwaitForQCopResponse ()
 
int width () const
 
int windowAt (const QPoint &)
 
QList< QWSWindowInfowindowList ()
 
 ~QWSDisplay ()
 

Static Public Functions

static void grab ()
 
static void grab (bool write)
 
static bool grabbed ()
 
static bool initLock (const QString &filename, bool create=false)
 
static QWSDisplayinstance ()
 
static void setRawMouseEventFilter (void(*filter)(QWSMouseEvent *))
 
static void setTransformation (int transformation, int screenNo=-1)
 
static void ungrab ()
 

Properties

Datad
 
char * getPropertyData
 
int getPropertyLen
 

Static Private Attributes

static QLocklock = 0
 

Friends

class Data
 
class QApplication
 
class QCopChannel
 
void qt_app_reinit (const QString &newAppName)
 
int qt_fork_qapplication ()
 
class QWSDirectPainterSurface
 
class QWSEmbedWidget
 
class QWSEmbedWidgetPrivate
 
class QWSMemorySurface
 
class QWSOnScreenSurface
 

Detailed Description

The QWSDisplay class provides a display for QWS; it is an internal class.

Warning
This function is not part of the public interface.

Definition at line 82 of file qwsdisplay_qws.h.

Constructors and Destructors

◆ QWSDisplay()

QWSDisplay::QWSDisplay ( )

Definition at line 1295 of file qapplication_qws.cpp.

1296 {
1297  d = new Data(0, qws_single_process);
1298 }
static bool qws_single_process
friend class Data

◆ ~QWSDisplay()

QWSDisplay::~QWSDisplay ( )

Definition at line 1300 of file qapplication_qws.cpp.

1301 {
1302  delete d;
1303  delete lock;
1304  lock = 0;
1305 }
static QLock * lock

Functions

◆ addProperty()

void QWSDisplay::addProperty ( int  winId,
int  property 
)

Definition at line 1367 of file qapplication_qws.cpp.

Referenced by qwsInitClipboard().

1368 {
1370  cmd.simpleData.windowid = winId;
1372  d->sendCommand(cmd);
1373 }
struct QWSAddPropertyCommand::SimpleData simpleData
void sendCommand(QWSCommand &cmd)
const char * property
Definition: qwizard.cpp:138

◆ convertSelection()

void QWSDisplay::convertSelection ( int  winId,
int  selectionProperty,
const QString mimeTypes 
)

Definition at line 1665 of file qapplication_qws.cpp.

1666 {
1667 #ifdef QT_NO_QWS_PROPERTIES
1668  Q_UNUSED(mimeTypes);
1669 #else
1670  // ### we need the atom/property thingy like in X here
1673  int(QWSPropertyManager::PropReplace), mimeTypes.toLatin1());
1674 #endif
1676  cmd.simpleData.requestor = winId;
1677  cmd.simpleData.selection = selectionProperty;
1678  cmd.simpleData.mimeTypes = QT_QWS_PROPERTY_CONVERTSELECTION;
1679  d->sendCommand(cmd);
1680 }
#define QT_QWS_PROPERTY_CONVERTSELECTION
void sendCommand(QWSCommand &cmd)
QByteArray toLatin1() const Q_REQUIRED_RESULT
Returns a Latin-1 representation of the string as a QByteArray.
Definition: qstring.cpp:3993
void addProperty(int winId, int property)
struct QWSConvertSelectionCommand::SimpleData simpleData
void setProperty(int winId, int property, int mode, const QByteArray &data)
#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

◆ defineCursor()

void QWSDisplay::defineCursor ( int  id,
const QBitmap curs,
const QBitmap mask,
int  hotX,
int  hotY 
)

Definition at line 1682 of file qapplication_qws.cpp.

1684 {
1685  const QImage cursImg = curs.toImage().convertToFormat(QImage::Format_MonoLSB);
1686  const QImage maskImg = mask.toImage().convertToFormat(QImage::Format_MonoLSB);
1687 
1689  cmd.simpleData.width = curs.width();
1690  cmd.simpleData.height = curs.height();
1691  cmd.simpleData.hotX = hotX;
1692  cmd.simpleData.hotY = hotY;
1693  cmd.simpleData.id = id;
1694 
1695 
1696  // must copy each scanline since there might be gaps between them
1697  const int height = curs.height();
1698  const int width = curs.width();
1699  const int dst_bpl = (width + 7) / 8;
1700 
1701  int dataLen = dst_bpl * height;
1702  uchar *data = new uchar[dataLen*2];
1703  uchar *dst = data;
1704 
1705  int src_bpl = cursImg.bytesPerLine();
1706  const uchar *cursSrc = cursImg.bits();
1707  for (int i = 0; i < height; ++i) {
1708  memcpy(dst, cursSrc + i*src_bpl, dst_bpl);
1709  dst += dst_bpl;
1710  }
1711 
1712  src_bpl = maskImg.bytesPerLine();
1713  const uchar *maskSrc = maskImg.bits();
1714  for (int i = 0; i < height; ++i) {
1715  memcpy(dst, maskSrc + i*src_bpl, dst_bpl);
1716  dst += dst_bpl;
1717  }
1718 
1719  cmd.setData(reinterpret_cast<char*>(data), dataLen*2);
1720  delete [] data;
1721  d->sendCommand(cmd);
1722 }
QImage toImage() const
Converts the pixmap to a QImage.
Definition: qpixmap.cpp:542
int width() const
Returns the width of the pixmap.
Definition: qpixmap.cpp:630
int bytesPerLine() const
Returns the number of bytes per image scanline.
Definition: qimage.cpp:1812
void sendCommand(QWSCommand &cmd)
unsigned char uchar
Definition: qglobal.h:994
The QImage class provides a hardware-independent image representation that allows direct access to th...
Definition: qimage.h:87
static const char * data(const QByteArray &arr)
int width() const
int height() const
uchar * bits()
Returns a pointer to the first pixel data.
Definition: qimage.cpp:1946
void setData(const char *d, int len, bool allocateMem=true)
QImage convertToFormat(Format f, Qt::ImageConversionFlags flags=Qt::AutoColor) const Q_REQUIRED_RESULT
Returns a copy of the image in the given format.
Definition: qimage.cpp:3966
struct QWSDefineCursorCommand::SimpleData simpleData
int height() const
Returns the height of the pixmap.
Definition: qpixmap.cpp:645

◆ depth()

int QWSDisplay::depth ( ) const

Definition at line 1359 of file qapplication_qws.cpp.

1359 { return qt_screen->depth(); }
Q_GUI_EXPORT QScreen * qt_screen
Definition: qscreen_qws.cpp:69
int depth() const
Returns the depth of the framebuffer, in bits per pixel.
Definition: qscreen_qws.h:229

◆ destroyCursor()

void QWSDisplay::destroyCursor ( int  id)

Definition at line 1724 of file qapplication_qws.cpp.

1725 {
1727  cmd.simpleData.width = 0;
1728  cmd.simpleData.height = 0;
1729  cmd.simpleData.hotX = 0;
1730  cmd.simpleData.hotY = 0;
1731  cmd.simpleData.id = id;
1732  cmd.setData(0, 0);
1733 
1734  d->sendCommand(cmd);
1735 }
void sendCommand(QWSCommand &cmd)
void setData(const char *d, int len, bool allocateMem=true)
struct QWSDefineCursorCommand::SimpleData simpleData

◆ destroyRegion()

void QWSDisplay::destroyRegion ( int  winId)

Definition at line 1572 of file qapplication_qws.cpp.

Referenced by isServerProcess(), and QWSDirectPainterSurface::~QWSDirectPainterSurface().

1573 {
1575  cmd.simpleData.windowid = winId;
1576  if (d->directServerConnection()) {
1577  qwsServer->d_func()->destroy_region(&cmd);
1578  } else {
1579  d->sendCommand(cmd);
1580  }
1581 }
struct QWSRegionDestroyCommand::SimpleData simpleData
void sendCommand(QWSCommand &cmd)
QWSServer Q_GUI_EXPORT * qwsServer

◆ eventPending()

bool QWSDisplay::eventPending ( ) const

Definition at line 1334 of file qapplication_qws.cpp.

Referenced by QEventDispatcherQWS::hasPendingEvents(), QEventDispatcherQWS::processEvents(), qwsEventSourceCheck(), qwsEventSourceDispatch(), and qwsEventSourcePrepare().

1335 {
1336 #ifndef QT_NO_QWS_MULTIPROCESS
1337  d->flush();
1338 #endif
1339  d->fillQueue();
1340  return d->queueNotEmpty();
1341 }

◆ flushCommands()

void QWSDisplay::flushCommands ( )

Definition at line 1762 of file qapplication_qws.cpp.

Referenced by QCopChannel::flush().

1763 {
1764  qt_fbdpy->d->flushCommands();
1765 }
Q_GUI_EXPORT QWSDisplay * qt_fbdpy

◆ frameBuffer()

uchar * QWSDisplay::frameBuffer ( ) const

Definition at line 1356 of file qapplication_qws.cpp.

1356 { return qt_screen->base(); }
Q_GUI_EXPORT QScreen * qt_screen
Definition: qscreen_qws.cpp:69
uchar * base() const
Returns a pointer to the beginning of the framebuffer.
Definition: qscreen_qws.h:235

◆ getEvent()

QWSEvent * QWSDisplay::getEvent ( )

Definition at line 1347 of file qapplication_qws.cpp.

Referenced by QEventDispatcherQWS::processEvents(), and qwsEventSourceDispatch().

1348 {
1349  d->fillQueue();
1350  Q_ASSERT(d->queueNotEmpty());
1351  QWSEvent* e = d->dequeue();
1352 
1353  return e;
1354 }
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
The QWSEvent class encapsulates an event in Qt for Embedded Linux.
Definition: qwsevent_qws.h:59

◆ getProperty()

bool QWSDisplay::getProperty ( int  winId,
int  property,
char *&  data,
int &  len 
)

Definition at line 1407 of file qapplication_qws.cpp.

1408 {
1409  if (d->directServerConnection()) {
1410  const char *propertyData;
1411  bool retval = qwsServer->d_func()->get_property(winId, property, propertyData, len);
1412  if (len <= 0) {
1413  data = 0;
1414  } else {
1415  data = new char[len];
1416  memcpy(data, propertyData, len) ;
1417  }
1418  return retval;
1419  }
1421  cmd.simpleData.windowid = winId;
1423  d->sendCommand(cmd);
1424 
1425  getPropertyLen = -2;
1426  getPropertyData = 0;
1427 
1428 #ifndef QT_NO_QWS_MULTIPROCESS
1430 #endif
1431 
1432  len = getPropertyLen;
1434 
1435  getPropertyLen = -2;
1436  getPropertyData = 0;
1437 
1438  return len != -1;
1439 }
void sendCommand(QWSCommand &cmd)
static const char * data(const QByteArray &arr)
char * getPropertyData
const char * property
Definition: qwizard.cpp:138
struct QWSGetPropertyCommand::SimpleData simpleData
QWSServer Q_GUI_EXPORT * qwsServer

◆ grab() [1/2]

void QWSDisplay::grab ( )
static

◆ grab() [2/2]

void QWSDisplay::grab ( bool  write)
static

Definition at line 1317 of file qapplication_qws.cpp.

1318 {
1319  lock->lock(write ? QLock::Write : QLock::Read);
1320 
1321 }
static QLock * lock
void lock(Type type)
Locks the semaphore with a lock of type t.
Definition: qlock.cpp:285

◆ grabbed()

bool QWSDisplay::grabbed ( )
static

Definition at line 1307 of file qapplication_qws.cpp.

Referenced by QWSDisplay::Data::waitForRegionEvents().

1308 {
1309  return lock->locked();
1310 }
static QLock * lock
bool locked() const
Returns true if the lock is currently held by the current process; otherwise returns false...
Definition: qlock.cpp:391

◆ grabKeyboard()

void QWSDisplay::grabKeyboard ( QWidget w,
bool  grab 
)

Definition at line 1831 of file qapplication_qws.cpp.

1832 {
1833  QWidget *top = w->window();
1835 #ifdef QT_DEBUG
1836  memset(cmd.simpleDataPtr, 0, sizeof(cmd.simpleData)); //shut up Valgrind
1837 #endif
1838  cmd.simpleData.windowid = top->winId();
1839  cmd.simpleData.grab = grab;
1840  d->sendCommand(cmd);
1841  d->flush();
1842 }
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
void sendCommand(QWSCommand &cmd)
static void grab()
QWidget * window() const
Returns the window for this widget, i.e.
Definition: qwidget.cpp:4492
WId winId() const
Returns the window system identifier of the widget.
Definition: qwidget.cpp:2557
struct QWSGrabKeyboardCommand::SimpleData simpleData

◆ grabMouse()

void QWSDisplay::grabMouse ( QWidget w,
bool  grab 
)

Definition at line 1818 of file qapplication_qws.cpp.

1819 {
1820  QWidget *top = w->window();
1821  QWSGrabMouseCommand cmd;
1822 #ifdef QT_DEBUG
1823  memset(cmd.simpleDataPtr, 0, sizeof(cmd.simpleData)); //shut up Valgrind
1824 #endif
1825  cmd.simpleData.windowid = top->winId();
1826  cmd.simpleData.grab = grab;
1827  d->sendCommand(cmd);
1828  d->flush();
1829 }
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
void sendCommand(QWSCommand &cmd)
static void grab()
struct QWSGrabMouseCommand::SimpleData simpleData
QWidget * window() const
Returns the window for this widget, i.e.
Definition: qwidget.cpp:4492
WId winId() const
Returns the window system identifier of the widget.
Definition: qwidget.cpp:2557

◆ height()

int QWSDisplay::height ( ) const

Definition at line 1358 of file qapplication_qws.cpp.

1358 { return qt_screen->height(); }
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

◆ initLock()

bool QWSDisplay::initLock ( const QString filename,
bool  create = false 
)
static

Definition at line 1639 of file qapplication_qws.cpp.

Referenced by QWSDisplay::Data::init(), and QWSDisplay::Data::reinit().

1640 {
1641  if (!lock) {
1642  lock = new QLock(filename, 'd', create);
1643 
1644  if (!lock->isValid()) {
1645  delete lock;
1646  lock = 0;
1647  return false;
1648  }
1649  }
1650 
1651  return true;
1652 }
static QLock * lock
static Expression::Ptr create(Expression *const expr, const YYLTYPE &sourceLocator, const ParserContext *const parseInfo)
The QLock class is a wrapper for a system shared semaphore.
Definition: qlock_p.h:62
bool isValid() const
Returns true if the lock constructor was successful; returns false if the lock could not be created o...
Definition: qlock.cpp:265

◆ instance()

static QWSDisplay* QWSDisplay::instance ( )
inlinestatic

◆ moveRegion()

void QWSDisplay::moveRegion ( int  winId,
int  dx,
int  dy 
)

Definition at line 1557 of file qapplication_qws.cpp.

Referenced by effectiveState().

1558 {
1560  cmd.simpleData.windowid = winId;
1561  cmd.simpleData.dx = dx;
1562  cmd.simpleData.dy = dy;
1563 
1564  if (d->directServerConnection()) {
1565  qwsServer->d_func()->move_region(&cmd);
1566  } else {
1567  d->sendSynchronousCommand(cmd);
1568  }
1569 // d->offsetPendingExpose(winId, QPoint(cmd.simpleData.dx, cmd.simpleData.dy));
1570 }
struct QWSRegionMoveCommand::SimpleData simpleData
void sendSynchronousCommand(QWSCommand &cmd)
QWSServer Q_GUI_EXPORT * qwsServer

◆ nameRegion()

void QWSDisplay::nameRegion ( int  winId,
const QString n,
const QString c 
)

Definition at line 1499 of file qapplication_qws.cpp.

Referenced by isServerProcess(), QWSDirectPainterSurface::QWSDirectPainterSurface(), QWSYellowSurface::QWSYellowSurface(), and QWSWindowSurface::winId().

1500 {
1502  cmd.simpleData.windowid = winId;
1503  cmd.setName(n, c);
1504  if (d->directServerConnection())
1505  qwsServer->d_func()->name_region(&cmd);
1506  else
1507  d->sendCommand(cmd);
1508 }
void sendCommand(QWSCommand &cmd)
void setName(const QString &n, const QString &c)
struct QWSRegionNameCommand::SimpleData simpleData
QWSServer Q_GUI_EXPORT * qwsServer

◆ pixmapDepth()

int QWSDisplay::pixmapDepth ( ) const

Definition at line 1360 of file qapplication_qws.cpp.

1360 { return qt_screen->pixmapDepth(); }
Q_GUI_EXPORT QScreen * qt_screen
Definition: qscreen_qws.cpp:69
virtual int pixmapDepth() const
Returns the preferred depth for pixmaps, in bits per pixel.

◆ playSoundFile()

void QWSDisplay::playSoundFile ( const QString f)

Definition at line 1738 of file qapplication_qws.cpp.

1739 {
1740  QWSPlaySoundCommand cmd;
1741  cmd.setFileName(f);
1742  d->sendCommand(cmd);
1743 }
void setFileName(const QString &n)
void sendCommand(QWSCommand &cmd)

◆ registerChannel()

void QWSDisplay::registerChannel ( const QString channel)

Definition at line 1747 of file qapplication_qws.cpp.

Referenced by QCopChannel::init(), and QCopChannel::reregisterAll().

1748 {
1750  reg.setChannel(channel);
1751  qt_fbdpy->d->sendCommand(reg);
1752 }
void setChannel(const QString &n)
void sendCommand(QWSCommand &cmd)
Q_GUI_EXPORT QWSDisplay * qt_fbdpy

◆ removeProperty()

void QWSDisplay::removeProperty ( int  winId,
int  property 
)

Definition at line 1396 of file qapplication_qws.cpp.

1397 {
1399  cmd.simpleData.windowid = winId;
1401  d->sendCommand(cmd);
1402 }
void sendCommand(QWSCommand &cmd)
const char * property
Definition: qwizard.cpp:138
struct QWSRemovePropertyCommand::SimpleData simpleData

◆ repaintRegion()

void QWSDisplay::repaintRegion ( int  winId,
int  windowFlags,
bool  opaque,
QRegion  r 
)

Definition at line 1524 of file qapplication_qws.cpp.

Referenced by QWSWindowSurface::flush(), QWSYellowSurface::flush(), and QWSDirectPainterSurface::flush().

1525 {
1526  if (d->directServerConnection()) {
1527  qwsServer->d_func()->repaint_region(winId, windowFlags, opaque, r);
1528  } else {
1529  QVector<QRect> ra = r.rects();
1530 
1531  /*
1532  for (int i = 0; i < ra.size(); i++) {
1533  QRect r(ra[i]);
1534  qDebug("rect: %d %d %d %d", r.x(), r.y(), r.right(), r.bottom());
1535  }
1536  */
1537 
1539  /* XXX QWSRegionCommand is padded out in a compiler dependent way.
1540  Zeroed out to avoid valgrind reporting uninitialized memory usage.
1541  */
1542 #ifdef QT_DEBUG
1543  memset(cmd.simpleDataPtr, 0, sizeof(cmd.simpleData)); //shut up Valgrind
1544 #endif
1545  cmd.simpleData.windowid = winId;
1546  cmd.simpleData.windowFlags = windowFlags;
1547  cmd.simpleData.opaque = opaque;
1548  cmd.simpleData.nrectangles = ra.count();
1549  cmd.setData(reinterpret_cast<const char *>(ra.constData()),
1550  ra.count() * sizeof(QRect), false);
1551 
1552  d->sendSynchronousCommand(cmd);
1553  }
1554 }
struct QWSRepaintRegionCommand::SimpleData simpleData
int count(const T &t) const
Returns the number of occurrences of value in the vector.
Definition: qvector.h:742
void setData(const char *d, int len, bool allocateMem=true)
QVector< QRect > rects() const
Returns an array of non-overlapping rectangles that make up the region.
Definition: qregion.cpp:4412
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
void sendSynchronousCommand(QWSCommand &cmd)
const T * constData() const
Returns a const pointer to the data stored in the vector.
Definition: qvector.h:154
QWSServer Q_GUI_EXPORT * qwsServer

◆ requestFocus()

void QWSDisplay::requestFocus ( int  winId,
bool  get 
)

Definition at line 1473 of file qapplication_qws.cpp.

Referenced by isServerProcess().

1474 {
1476  cmd.simpleData.windowid = winId;
1477  cmd.simpleData.flag = get;
1478  if (d->directServerConnection())
1479  qwsServer->d_func()->request_focus(&cmd);
1480  else
1481  d->sendCommand(cmd);
1482 }
struct QWSRequestFocusCommand::SimpleData simpleData
void sendCommand(QWSCommand &cmd)
QWSServer Q_GUI_EXPORT * qwsServer

◆ requestRegion()

void QWSDisplay::requestRegion ( int  winId,
const QString surfacekey,
const QByteArray surfaceData,
const QRegion region 
)

Definition at line 1510 of file qapplication_qws.cpp.

Referenced by QWSYellowSurface::flush(), QWidget::setAttribute(), QWSWindowSurface::setGeometry(), and QWSDirectPainterSurface::setRegion().

1513 {
1514  if (d->directServerConnection()) {
1515  qwsServer->d_func()->request_region(winId, surfaceKey,
1516  surfaceData, region);
1517  } else {
1518  QWSRegionCommand cmd;
1519  cmd.setData(winId, surfaceKey, surfaceData, region);
1520  d->sendSynchronousCommand(cmd);
1521  }
1522 }
void setData(const char *d, int len, bool allocateMem=true)
void sendSynchronousCommand(QWSCommand &cmd)
QWSServer Q_GUI_EXPORT * qwsServer

◆ resetIM()

void QWSDisplay::resetIM ( )

Definition at line 1615 of file qapplication_qws.cpp.

Referenced by QWSInputContext::reset().

1616 {
1618 }
void sendIMUpdate(int type, int winId, int widgetid)

◆ selectCursor()

void QWSDisplay::selectCursor ( QWidget w,
unsigned int  id 
)

Definition at line 1795 of file qapplication_qws.cpp.

Referenced by effectiveState(), parseGeometry(), and QApplication::qwsProcessEvent().

1796 {
1797  if (cursId != qt_last_cursor)
1798  {
1799  QWidget *top = w->window();
1800  qt_last_cursor = cursId;
1802  cmd.simpleData.windowid = top->internalWinId();
1803  cmd.simpleData.id = cursId;
1804  d->sendCommand(cmd);
1805  d->flush();
1806  }
1807 }
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
void sendCommand(QWSCommand &cmd)
WId qt_last_cursor
struct QWSSelectCursorCommand::SimpleData simpleData
WId internalWinId() const
Returns the window system identifier of the widget, or 0 if the widget is not created yet...
Definition: qwidget.h:244
QWidget * window() const
Returns the window for this widget, i.e.
Definition: qwidget.cpp:4492

◆ sendFontCommand()

void QWSDisplay::sendFontCommand ( int  type,
const QByteArray fontName 
)

Definition at line 1779 of file qapplication_qws.cpp.

Referenced by QFontEngineQPF::QFontEngineQPF(), and QFontEngineQPF::~QFontEngineQPF().

1780 {
1781  QWSFontCommand cmd;
1782  cmd.simpleData.type = type;
1783  cmd.setFontName(fontName);
1784  d->sendCommand(cmd);
1785 }
int type
Definition: qmetatype.cpp:239
void setFontName(const QByteArray &name)
void sendCommand(QWSCommand &cmd)
struct QWSFontCommand::SimpleData simpleData

◆ sendIMMouseEvent()

void QWSDisplay::sendIMMouseEvent ( int  index,
bool  isPress 
)

Definition at line 1620 of file qapplication_qws.cpp.

Referenced by QWSInputContext::mouseHandler().

1621 {
1622  QWSIMMouseCommand cmd;
1623  cmd.simpleData.index = index;
1625  if (d->directServerConnection()) {
1626  qwsServer->d_func()->send_im_mouse(&cmd);
1627  } else {
1628  d->sendCommand(cmd);
1629  }
1630 }
struct QWSIMMouseCommand::SimpleData simpleData
void sendCommand(QWSCommand &cmd)
quint16 index
QWSServer Q_GUI_EXPORT * qwsServer

◆ sendIMResponse()

void QWSDisplay::sendIMResponse ( int  winId,
int  property,
const QVariant result 
)

Definition at line 1600 of file qapplication_qws.cpp.

Referenced by QWSInputContext::translateIMQueryEvent().

1601 {
1603  cmd.simpleData.windowid = winId;
1605 
1606  cmd.setResult(result);
1607 
1608  if (d->directServerConnection()) {
1609  qwsServer->d_func()->im_response(&cmd);
1610  } else {
1611  d->sendCommand(cmd);
1612  }
1613 }
struct QWSIMResponseCommand::SimpleData simpleData
void sendCommand(QWSCommand &cmd)
void setResult(const QVariant &v)
const char * property
Definition: qwizard.cpp:138
QWSServer Q_GUI_EXPORT * qwsServer

◆ sendIMUpdate()

void QWSDisplay::sendIMUpdate ( int  type,
int  winId,
int  widgetid 
)

Definition at line 1585 of file qapplication_qws.cpp.

Referenced by QWSInputContext::setFocusWidget(), and QWSInputContext::update().

1586 {
1587  QWSIMUpdateCommand cmd;
1588  cmd.simpleData.windowid = winId;
1589  cmd.simpleData.widgetid = widgetid;
1590 
1591  cmd.simpleData.type = type;
1592 
1593  if (d->directServerConnection()) {
1594  qwsServer->d_func()->im_update(&cmd);
1595  } else {
1596  d->sendCommand(cmd);
1597  }
1598 }
int type
Definition: qmetatype.cpp:239
void sendCommand(QWSCommand &cmd)
struct QWSIMUpdateCommand::SimpleData simpleData
QWSServer Q_GUI_EXPORT * qwsServer

◆ sendMessage()

void QWSDisplay::sendMessage ( const QString channel,
const QString msg,
const QByteArray data 
)

Definition at line 1754 of file qapplication_qws.cpp.

Referenced by QCopChannel::send().

1756 {
1757  QWSQCopSendCommand com;
1758  com.setMessage(channel, msg, data);
1759  qt_fbdpy->d->sendCommand(com);
1760 }
void sendCommand(QWSCommand &cmd)
void setMessage(const QString &c, const QString &m, const QByteArray &data)
Q_GUI_EXPORT QWSDisplay * qt_fbdpy

◆ setAltitude()

void QWSDisplay::setAltitude ( int  winId,
int  altitude,
bool  fixed = false 
)

Definition at line 1443 of file qapplication_qws.cpp.

Referenced by effectiveState(), QWSYellowSurface::flush(), isServerProcess(), QDirectPainter::lower(), QWSYellowSurface::QWSYellowSurface(), QDirectPainter::raise(), and QWSWindowSurface::winId().

1444 {
1446 #ifdef QT_DEBUG
1447  memset(cmd.simpleDataPtr, 0, sizeof(cmd.simpleData)); //shut up Valgrind
1448 #endif
1449  cmd.simpleData.windowid = winId;
1451  cmd.simpleData.fixed = fixed;
1452  if (d->directServerConnection()) {
1453  qwsServer->d_func()->set_altitude(&cmd);
1454  } else {
1455  d->sendSynchronousCommand(cmd);
1456  }
1457 }
Q_CORE_EXPORT QTextStream & fixed(QTextStream &s)
struct QWSChangeAltitudeCommand::SimpleData simpleData
void sendSynchronousCommand(QWSCommand &cmd)
QWSServer Q_GUI_EXPORT * qwsServer

◆ setCursorPosition()

void QWSDisplay::setCursorPosition ( int  x,
int  y 
)

Definition at line 1809 of file qapplication_qws.cpp.

1810 {
1812  cmd.simpleData.newX = x;
1813  cmd.simpleData.newY = y;
1814  d->sendCommand(cmd);
1815  d->flush();
1816 }
struct QWSPositionCursorCommand::SimpleData simpleData
void sendCommand(QWSCommand &cmd)

◆ setIdentity()

void QWSDisplay::setIdentity ( const QString appName)

Definition at line 1484 of file qapplication_qws.cpp.

1485 {
1486  QWSIdentifyCommand cmd;
1487 #ifdef QT_NO_QWS_MULTIPROCESS
1488  const int id = -1;
1489 #else
1491 #endif
1492  cmd.setId(appName, id);
1493  if (d->directServerConnection())
1494  qwsServer->d_func()->set_identity(&cmd);
1495  else
1496  d->sendCommand(cmd);
1497 }
static QWSLock * clientLock
void setId(const QString &i, int lock)
void sendCommand(QWSCommand &cmd)
int id() const
Definition: qwslock_p.h:78
QWSServer Q_GUI_EXPORT * qwsServer

◆ setOpacity()

void QWSDisplay::setOpacity ( int  winId,
int  opacity 
)

Definition at line 1459 of file qapplication_qws.cpp.

Referenced by effectiveState().

1460 {
1462  cmd.simpleData.windowid = winId;
1463  cmd.simpleData.opacity = opacity;
1464  if (d->directServerConnection()) {
1465  qwsServer->d_func()->set_opacity(&cmd);
1466  } else {
1467  d->sendCommand(cmd);
1468  }
1469 }
struct QWSSetOpacityCommand::SimpleData simpleData
void sendCommand(QWSCommand &cmd)
QWSServer Q_GUI_EXPORT * qwsServer

◆ setProperty() [1/2]

void QWSDisplay::setProperty ( int  winId,
int  property,
int  mode,
const QByteArray data 
)

Definition at line 1375 of file qapplication_qws.cpp.

1376 {
1378  cmd.simpleData.windowid = winId;
1380  cmd.simpleData.mode = mode;
1381  cmd.setData(data.constData(), data.size());
1382  d->sendCommand(cmd);
1383 }
struct QWSSetPropertyCommand::SimpleData simpleData
void setData(const char *d, int len, bool allocateMem=true)
void sendCommand(QWSCommand &cmd)
const char * constData() const
Returns a pointer to the data stored in the byte array.
Definition: qbytearray.h:433
const char * property
Definition: qwizard.cpp:138
int size() const
Returns the number of bytes in this byte array.
Definition: qbytearray.h:402

◆ setProperty() [2/2]

void QWSDisplay::setProperty ( int  winId,
int  property,
int  mode,
const char *  data 
)

Definition at line 1385 of file qapplication_qws.cpp.

1387 {
1389  cmd.simpleData.windowid = winId;
1391  cmd.simpleData.mode = mode;
1392  cmd.setData(data, strlen(data));
1393  d->sendCommand(cmd);
1394 }
struct QWSSetPropertyCommand::SimpleData simpleData
void setData(const char *d, int len, bool allocateMem=true)
void sendCommand(QWSCommand &cmd)
static const char * data(const QByteArray &arr)
const char * property
Definition: qwizard.cpp:138

◆ setRawMouseEventFilter()

void QWSDisplay::setRawMouseEventFilter ( void(*)(QWSMouseEvent *)  filter)
static

Definition at line 1875 of file qapplication_qws.cpp.

1876 {
1877  if (qt_fbdpy)
1879 }
Q_GUI_EXPORT QWSDisplay * qt_fbdpy
QFuture< void > filter(Sequence &sequence, FilterFunction filterFunction)
void setMouseFilter(void(*filter)(QWSMouseEvent *))

◆ setSelectionOwner()

void QWSDisplay::setSelectionOwner ( int  winId,
const QTime time 
)

Definition at line 1654 of file qapplication_qws.cpp.

1655 {
1657  cmd.simpleData.windowid = winId;
1658  cmd.simpleData.hour = time.hour();
1659  cmd.simpleData.minute = time.minute();
1660  cmd.simpleData.sec = time.second();
1661  cmd.simpleData.ms = time.msec();
1662  d->sendCommand(cmd);
1663 }
int msec() const
Returns the millisecond part (0 to 999) of the time.
Definition: qdatetime.cpp:1611
struct QWSSetSelectionOwnerCommand::SimpleData simpleData
void sendCommand(QWSCommand &cmd)
int second() const
Returns the second part (0 to 59) of the time.
Definition: qdatetime.cpp:1600
int minute() const
Returns the minute part (0 to 59) of the time.
Definition: qdatetime.cpp:1589
int hour() const
Returns the hour part (0 to 23) of the time.
Definition: qdatetime.cpp:1578

◆ setTransformation()

static void QWSDisplay::setTransformation ( int  transformation,
int  screenNo = -1 
)
static

◆ setWindowCaption()

void QWSDisplay::setWindowCaption ( QWidget w,
const QString c 
)

Definition at line 1787 of file qapplication_qws.cpp.

Referenced by isServerProcess().

1788 {
1789  if (w->isWindow()) {
1790  nameRegion(w->internalWinId(), w->objectName(), c);
1791  static_cast<QETWidget *>(w)->repaintDecoration(qApp->desktop()->rect(), true);
1792  }
1793 }
void nameRegion(int winId, const QString &n, const QString &c)
unsigned char c[8]
Definition: qnumeric_p.h:62
bool isWindow() const
Returns true if the widget is an independent window, otherwise returns false.
Definition: qwidget.h:945
#define qApp
QString objectName() const
WId internalWinId() const
Returns the window system identifier of the widget, or 0 if the widget is not created yet...
Definition: qwidget.h:244

◆ sharedRam()

uchar * QWSDisplay::sharedRam ( ) const

Definition at line 1362 of file qapplication_qws.cpp.

1362 { return d->sharedRam; }

◆ sharedRamSize()

int QWSDisplay::sharedRamSize ( ) const

Definition at line 1363 of file qapplication_qws.cpp.

1363 { return d->sharedRamSize; }

◆ supportsDepth()

bool QWSDisplay::supportsDepth ( int  depth) const

Definition at line 1361 of file qapplication_qws.cpp.

1361 { return qt_screen->supportsDepth(depth); }
Q_GUI_EXPORT QScreen * qt_screen
Definition: qscreen_qws.cpp:69
int depth() const
virtual bool supportsDepth(int) const
Returns true if the screen supports the specified color depth; otherwise returns false.

◆ takeId()

int QWSDisplay::takeId ( )

Definition at line 1634 of file qapplication_qws.cpp.

Referenced by isServerProcess(), and QWSWindowSurface::winId().

1635 {
1636  return d->takeId();
1637 }

◆ ungrab()

void QWSDisplay::ungrab ( )
static

◆ waitForQCopResponse()

QWSQCopMessageEvent * QWSDisplay::waitForQCopResponse ( )

Definition at line 1770 of file qapplication_qws.cpp.

Referenced by QCopChannel::isRegistered().

1771 {
1773  QWSQCopMessageEvent *e = static_cast<QWSQCopMessageEvent*>(qt_fbdpy->d->dequeue());
1775  return e;
1776 }
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
Q_GUI_EXPORT QWSDisplay * qt_fbdpy

◆ width()

int QWSDisplay::width ( ) const

Definition at line 1357 of file qapplication_qws.cpp.

1357 { return qt_screen->width(); }
Q_GUI_EXPORT QScreen * qt_screen
Definition: qscreen_qws.cpp:69
int width() const
Returns the logical width of the framebuffer in pixels.
Definition: qscreen_qws.h:227

◆ windowAt()

int QWSDisplay::windowAt ( const QPoint p)

Definition at line 1863 of file qapplication_qws.cpp.

Referenced by parseGeometry().

1864 {
1865  //### currently only implemented for the server process
1866  int ret = 0;
1867  if(d->directServerConnection()) {
1868  QWSWindow *win = qwsServer->windowAt(p);
1869  if (win)
1870  return win->winId();
1871  }
1872  return ret;
1873 }
The QWSWindow class encapsulates a top-level window in Qt for Embedded Linux.
QWSWindow * windowAt(const QPoint &pos)
Returns the window containing the given position.
int winId() const
Returns the window&#39;s ID.
QWSServer Q_GUI_EXPORT * qwsServer

◆ windowList()

QList< QWSWindowInfo > QWSDisplay::windowList ( )

Definition at line 1844 of file qapplication_qws.cpp.

1845 {
1847  if(d->directServerConnection()) {
1849  for (int i = 0; i < qin->count(); ++i) {
1850  QWSInternalWindowInfo * qwi = qin->at(i);
1851  QWSWindowInfo tmp;
1852  tmp.winid = qwi->winid;
1853  tmp.clientid = qwi->clientid;
1854  tmp.name = QString(qwi->name);
1855  ret.append(tmp);
1856  }
1857  qDeleteAll(*qin);
1858  delete qin;
1859  }
1860  return ret;
1861 }
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
The QString class provides a Unicode character string.
Definition: qstring.h:83
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 QList< QWSInternalWindowInfo * > * windowList()
unsigned int clientid
Q_OUTOFLINE_TEMPLATE void qDeleteAll(ForwardIterator begin, ForwardIterator end)
Definition: qalgorithms.h:319
The QList class is a template class that provides lists.
Definition: qdatastream.h:62

Friends and Related Functions

◆ Data

friend class Data
friend

Definition at line 169 of file qwsdisplay_qws.h.

◆ QApplication

friend class QApplication
friend

Definition at line 165 of file qwsdisplay_qws.h.

◆ QCopChannel

friend class QCopChannel
friend

Definition at line 166 of file qwsdisplay_qws.h.

◆ qt_app_reinit

void qt_app_reinit ( const QString newAppName)
friend

Definition at line 690 of file qapplication_qws.cpp.

691 {
692  qt_fbdpy->d->reinit( newAppName );
693 }
void reinit(const QString &newAppName)
Q_GUI_EXPORT QWSDisplay * qt_fbdpy

◆ qt_fork_qapplication

int qt_fork_qapplication ( )
friend

◆ QWSDirectPainterSurface

Definition at line 175 of file qwsdisplay_qws.h.

◆ QWSEmbedWidget

friend class QWSEmbedWidget
friend

Definition at line 167 of file qwsdisplay_qws.h.

◆ QWSEmbedWidgetPrivate

Definition at line 168 of file qwsdisplay_qws.h.

◆ QWSMemorySurface

friend class QWSMemorySurface
friend

Definition at line 173 of file qwsdisplay_qws.h.

◆ QWSOnScreenSurface

friend class QWSOnScreenSurface
friend

Definition at line 174 of file qwsdisplay_qws.h.

Properties

◆ d

Data* QWSDisplay::d
private

◆ getPropertyData

char* QWSDisplay::getPropertyData
private

Definition at line 177 of file qwsdisplay_qws.h.

Referenced by QWSDisplay::Data::fillQueue().

◆ getPropertyLen

int QWSDisplay::getPropertyLen
private

◆ lock

QLock * QWSDisplay::lock = 0
staticprivate

Definition at line 178 of file qwsdisplay_qws.h.


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