Qt 4.8
Classes | Functions | Variables
qclipboard_qws.cpp File Reference
#include "qclipboard.h"
#include "qapplication.h"
#include "qbitmap.h"
#include "qdatetime.h"
#include "qbuffer.h"
#include "qwidget.h"
#include "qevent.h"
#include <qwsdisplay_qws.h>
#include <qwsproperty_qws.h>
#include <qwsevent_qws.h>

Go to the source code of this file.

Classes

class  QClipboardData
 

Functions

static void cleanupClipboardData ()
 
static QClipboardDataclipboardData ()
 
static QString qwsClipboardText ()
 
static void qwsInitClipboard ()
 
static void qwsSetClipboardText (const QString &s)
 

Variables

static bool init = false
 
static QClipboardDatainternalCbData = 0
 
static const int TextClipboard =424242
 

Function Documentation

◆ cleanupClipboardData()

static void cleanupClipboardData ( )
static

Definition at line 166 of file qclipboard_qws.cpp.

Referenced by clipboardData().

167 {
168  delete internalCbData;
169  internalCbData = 0;
170 }
static QClipboardData * internalCbData

◆ clipboardData()

static QClipboardData* clipboardData ( )
static

Definition at line 172 of file qclipboard_qws.cpp.

173 {
174  if (internalCbData == 0) {
177  }
178  return internalCbData;
179 }
static QClipboardData * internalCbData
static void cleanupClipboardData()
void qAddPostRoutine(QtCleanUpFunction ptr)
Adds a global routine that will be called from the QApplication destructor.

◆ qwsClipboardText()

static QString qwsClipboardText ( )
static

Definition at line 78 of file qclipboard_qws.cpp.

Referenced by clipboardData().

79 {
80  char * data;
81  int len;
83  if( !QPaintDevice::qwsDisplay()->getProperty(0, TextClipboard, data, len) ) {
84 // qDebug("Property received: %d bytes", len);
85  }
86 
87  QString s((const QChar*)data, len/sizeof(QChar));
88  // qDebug("Property received: '%s'", s.toAscii().constData());
89  delete[] data;
90  return s;
91 }
static void qwsInitClipboard()
static const int TextClipboard
static QWSDisplay * qwsDisplay()
The QString class provides a Unicode character string.
Definition: qstring.h:83
The QChar class provides a 16-bit Unicode character.
Definition: qchar.h:72
static const char * data(const QByteArray &arr)

◆ qwsInitClipboard()

static void qwsInitClipboard ( )
inlinestatic

Definition at line 69 of file qclipboard_qws.cpp.

Referenced by qwsClipboardText(), and qwsSetClipboardText().

70 {
71  //### this should go into QWSServer; it only needs to happen once.
72  if( !init ) {
74  init = true;
75  }
76 }
static const int TextClipboard
static QWSDisplay * qwsDisplay()
static bool init
void addProperty(int winId, int property)

◆ qwsSetClipboardText()

static void qwsSetClipboardText ( const QString s)
static

Definition at line 94 of file qclipboard_qws.cpp.

Referenced by clipboardData().

95 {
97  // qDebug("qwsSetClipboardText( %s )", s.toAscii().data());
98  int len = s.length()*sizeof(QChar);
99  QByteArray ba((const char*)s.unicode(), len);
101  setProperty(0, TextClipboard, QWSPropertyManager::PropReplace, ba);
102 
103 }
static void qwsInitClipboard()
static const int TextClipboard
static QWSDisplay * qwsDisplay()
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
int length() const
Returns the number of characters in this string.
Definition: qstring.h:696
The QChar class provides a 16-bit Unicode character.
Definition: qchar.h:72
const QChar * unicode() const
Returns a &#39;\0&#39;-terminated Unicode representation of the string.
Definition: qstring.h:706

Variable Documentation

◆ init

bool init = false
static

Definition at line 67 of file qclipboard_qws.cpp.

Referenced by MetaObjectGenerator::addClassInfo(), QGLPixelBufferPrivate::common_init(), QDeclarativeCompiler::compileTree(), QThreadData::current(), QWSDisplay::Data::Data(), QSvgHandler::defaultPen(), QFontEngineFT::draw(), QGridLayoutEngine::fillRowData(), QX11PixmapData::fromImage(), QDeclarativeCompiler::genComponent(), QDeclarativeCompiler::genObjectBody(), QGraphicsLayoutItemPrivate::get(), QGridLayoutPrivate::getItemPosition(), QGtkStylePrivate::gtkWidgetMap(), QVNCServer::hasClientCursor(), QWinInputContext::identifierName(), QFontEngineFT::init(), QStyleOption::initFrom(), QFontEngineFTRawFont::initFromData(), QGLGlobalShareWidget::initializing(), EventLoopHelper::initWithEventLoopIntegration:, AudioPlayerDelegate::initWithMediaObject:, main(), QGLExtensionMatcher::match(), QCss::Parser::Parser(), QCoreTextFontDatabase::populateFontDatabase(), QPAEventDispatcherGlib::processEvents(), QAbstractEventDispatcherPrivate::QAbstractEventDispatcherPrivate(), QCocoaAutoReleasePool::QCocoaAutoReleasePool(), QDeclarativeData::QDeclarativeData(), QDeclarativeGridViewPrivate::QDeclarativeGridViewPrivate(), QDeclarativeListViewPrivate::QDeclarativeListViewPrivate(), QDeclarativePauseAnimationPrivate::QDeclarativePauseAnimationPrivate(), QDeclarativePropertyActionPrivate::QDeclarativePropertyActionPrivate(), QDeclarativePropertyAnimationPrivate::QDeclarativePropertyAnimationPrivate(), QFileDialogComboBox::QFileDialogComboBox(), QFileSystemModelPrivate::QFileSystemModelPrivate(), QGLPixelBufferPrivate::QGLPixelBufferPrivate(), QGridLayoutPrivate::QGridLayoutPrivate(), QLineControl::QLineControl(), QMacCocoaAutoReleasePool::QMacCocoaAutoReleasePool(), QMessageBoxPrivate::QMessageBoxPrivate(), QPictureIO::QPictureIO(), QPrintPreviewDialogPrivate::QPrintPreviewDialogPrivate(), QPrintPreviewWidgetPrivate::QPrintPreviewWidgetPrivate(), QSqlDatabasePrivate::QSqlDatabasePrivate(), qt_free_tls(), qt_init(), qt_mix_colors(), QTableViewPrivate::QTableViewPrivate(), QUIKitScreen::QUIKitScreen(), QWindowsXPStylePrivate::QWindowsXPStylePrivate(), QWizardPrivate::QWizardPrivate(), qwsInitClipboard(), QWSPcMouseSubHandler_intellimouse::QWSPcMouseSubHandler_intellimouse(), QWSPcMouseSubHandler_mouseman::QWSPcMouseSubHandler_mouseman(), QWSPcMouseSubHandler_mousesystems::QWSPcMouseSubHandler_mousesystems(), QWSPcMouseSubHandler_ms::QWSPcMouseSubHandler_ms(), QWSServerSocket::QWSServerSocket(), QXmlInputSource::QXmlInputSource(), QXmlSimpleReaderPrivate::refAddC(), QPalette::resolve(), QDeclarativeCompiledBindingsPrivate::run(), QVNCServer::setCursor(), QGLGlobalShareWidget::shareWidget(), QPainter::testRenderHint(), QSplitterPrivate::trans(), QAbstractPlatformMenuBar::~QAbstractPlatformMenuBar(), QComboBoxPrivate::~QComboBoxPrivate(), QGLFramebufferObjectPrivate::~QGLFramebufferObjectPrivate(), QGLWidgetPrivate::~QGLWidgetPrivate(), QHttpPrivate::~QHttpPrivate(), QMenuPrivate::~QMenuPrivate(), QSingleDesktopWidget::~QSingleDesktopWidget(), and QWindowsXPStylePrivate::~QWindowsXPStylePrivate().

◆ internalCbData

QClipboardData* internalCbData = 0
static

Definition at line 164 of file qclipboard_qws.cpp.

Referenced by cleanupClipboardData(), and clipboardData().

◆ TextClipboard

const int TextClipboard =424242
static

Definition at line 66 of file qclipboard_qws.cpp.

Referenced by qwsClipboardText(), qwsInitClipboard(), and qwsSetClipboardText().