47 #include <QtCore/QTextCodec> 48 #include <QtGui/QImageWriter> 49 #include <QtCore/QBuffer> 69 char *atom = XGetAtomName(display, a);
127 }
else if (a == XA_STRING) {
137 char *list[] = { strData.
data(), NULL };
140 ? XCompoundTextStyle : XStdICCTextStyle;
141 XTextProperty textprop;
143 && XmbTextListToTextProperty(display, list, 1, style,
145 *atomFormat = textprop.encoding;
146 *dataFormat = textprop.format;
147 *data =
QByteArray((
const char *) textprop.value, textprop.nitems * textprop.format / 8);
150 XFree(textprop.value);
159 *data =
QByteArray(reinterpret_cast<const char *>(mozUri.utf16()), mozUri.length() * 2);
161 }
else if ((a == XA_PIXMAP || a == XA_BITMAP) && mimeData->
hasImage()) {
165 return ret && data != 0;
198 if (atomName == format)
232 if (data.
size() > 1 && data.
at(1) == 0)
240 if (a == XA_PIXMAP && data.
size() ==
sizeof(Pixmap)) {
241 Pixmap xpm = *((Pixmap*)data.
data());
252 XGetGeometry(display, xpm, &root, &x, &y, &width, &height, &border_width, &depth);
253 XImage *ximg = XGetImage(display,xpm,x,y,width,height,AllPlanes,depth==1 ? XYPixmap : ZPixmap);
262 imageWriter.
write(qimg);
271 requestedEncoding->
clear();
312 *requestedEncoding =
"utf-8";
The QVariant class acts like a union for the most common Qt data types.
QBool contains(QChar c, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
static QString fromLocal8Bit(const char *, int size=-1)
Returns a QString initialized with the first size characters of the 8-bit string str.
char * data()
Returns a pointer to the data stored in the byte array.
static QString mimeAtomToString(Display *display, Atom a)
bool open(OpenMode openMode)
Reimplemented Function
The QByteArray class provides an array of bytes.
bool startsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string starts with s; otherwise returns false.
static bool mimeDataForAtom(Display *display, Atom a, QMimeData *mimeData, QByteArray *data, Atom *atomFormat, int *dataFormat)
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
long ASN1_INTEGER_get ASN1_INTEGER * a
QByteArray data(const QString &mimetype) const
Returns the data stored in the object in the format described by the MIME type specified by mimeType...
The QBuffer class provides a QIODevice interface for a QByteArray.
The QString class provides a Unicode character string.
The QChar class provides a 16-bit Unicode character.
static QString fromRawData(const QChar *, int size)
Constructs a QString that uses the first size Unicode characters in the array unicode.
void append(const T &t)
Inserts value at the end of the list.
Q_GUI_EXPORT EGLDisplay display()
QBool contains(const T &t) const
Returns true if the list contains an occurrence of value; otherwise returns false.
QByteArray & buffer()
Returns a reference to the QBuffer's internal buffer.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
The QImageWriter class provides a format independent interface for writing images to files or other d...
The QStringList class provides a list of strings.
static QString fromUtf8(const char *, int size=-1)
Returns a QString initialized with the first size bytes of the UTF-8 string str.
QStringList formats() const
Returns a list of formats supported by the object.
The QImage class provides a hardware-independent image representation that allows direct access to th...
static bool hasFormatHelper(const QString &mimeType, const QMimeData *data)
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
static QTextCodec * codec(MYSQL *mysql)
Type
This enum type defines the types of variable that a QVariant can contain.
static void split(QT_FT_Vector *b)
static QStringList mimeFormatsForAtom(Display *display, Atom a)
QByteArray toLatin1() const Q_REQUIRED_RESULT
Returns a Latin-1 representation of the string as a QByteArray.
The QMimeData class provides a container for data that records information about its MIME type...
QByteArray toLocal8Bit() const Q_REQUIRED_RESULT
Returns the local 8-bit representation of the string as a QByteArray.
static QByteArray renderDataHelper(const QString &mimeType, const QMimeData *data)
static Atom atom(X11Atom atom)
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.
bool hasImage() const
Returns true if the object can return an image; otherwise returns false.
static QVariant mimeConvertToFormat(Display *display, Atom a, const QByteArray &data, const QString &format, QVariant::Type requestedType, const QByteArray &encoding)
QString toUnicode(const QByteArray &) const
Converts a from the encoding of this codec to Unicode, and returns the result in a QString...
QList< QByteArray > split(char sep) const
Splits the byte array into subarrays wherever sep occurs, and returns the list of those arrays...
void setDevice(QIODevice *device)
Sets QImageWriter's device to device.
static Atom mimeStringToAtom(Display *display, const QString &mimeType)
QString & append(QChar c)
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
static QList< Atom > mimeAtomsForFormat(Display *display, const QString &format)
static QTextCodec * codecForName(const QByteArray &name)
Searches all installed QTextCodec objects and returns the one which best matches name; the match is c...
int size() const
Returns the number of bytes in this byte array.
static QImage qimageFromXImage(XImage *xi)
void setFormat(const QByteArray &format)
Sets the format QImageWriter will use when writing images, to format.
bool isEmpty() const
Returns true if the byte array has size 0; otherwise returns false.
static Atom mimeAtomForFormat(Display *display, const QString &format, QVariant::Type requestedType, const QList< Atom > &atoms, QByteArray *requestedEncoding)
The QTextCodec class provides conversions between text encodings.
char at(int i) const
Returns the character at index position i in the byte array.
bool write(const QImage &image)
Writes the image image to the assigned device or file name.
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
void clear()
Clears the contents of the byte array and makes it empty.
The QList class is a template class that provides lists.