44 #include <QtCore/qbytearray.h> 45 #include <QtCore/qhash.h> 46 #include <QtCore/qstring.h> 47 #include <QtCore/qvarlengtharray.h> 136 const char *
direction =
"Out",
int id = -1);
217 typeName =
"QDBusRawType<0x" + signature.
toHex() +
">*";
225 if (signature ==
"av") {
226 result.
name =
"QVariantList";
228 }
else if (signature ==
"a{sv}") {
229 result.
name =
"QVariantMap";
232 result.
name =
"QDBusRawType::" + signature;
252 for ( ; method_it != method_end; ++method_it) {
313 prototype[prototype.
length() - 1] =
')';
320 mm.
tag =
"Q_NOREPLY";
334 for ( ; signal_it != signal_end; ++signal_it) {
368 prototype[prototype.
length() - 1] =
')';
385 for ( ; prop_it != prop_end; ++prop_it) {
405 mp.
flags |= 0xff << 24;
406 else if (mp.
type < 0xff)
442 int data_size = idata.
size() +
447 idata.
resize(data_size + 1);
457 idata[typeidOffset++] = 0;
465 idata[offset++] = stringdata.
length();
466 stringdata +=
it.key();
468 idata[offset++] = stringdata.
length();
471 idata[offset++] = stringdata.
length();
474 idata[offset++] = stringdata.
length();
475 stringdata += mm.
tag;
477 idata[offset++] = mm.
flags;
479 idata[signatureOffset++] = stringdata.
length();
480 stringdata += mm.
name;
482 idata[signatureOffset++] = stringdata.
length();
485 idata[signatureOffset++] = stringdata.
length();
489 idata[signatureOffset++] = typeidOffset;
494 idata[signatureOffset++] = typeidOffset;
511 idata[offset++] = stringdata.
length();
512 stringdata +=
it.key();
514 idata[offset++] = stringdata.
length();
517 idata[offset++] = mp.
flags;
519 idata[signatureOffset++] = stringdata.
length();
522 idata[signatureOffset++] = mp.
type;
528 char *string_data =
new char[stringdata.
length()];
529 memcpy(string_data, stringdata, stringdata.
length());
532 memcpy(uint_data, idata.
data(), idata.
size() *
sizeof(int));
535 obj->
d.
data = uint_data;
550 memset(header, 0,
sizeof *header);
551 header->revision = 1;
554 char *stringdata =
new char[
name.length() + 1];
555 stringdata[
name.length()] =
'\0';
557 d.data =
reinterpret_cast<uint*
>(header);
559 d.stringdata = stringdata;
578 for ( ; it !=
end; ++
it) {
587 generator.
write(obj);
591 cache.
insert(it.key(), obj);
613 }
else if (interface.
isEmpty()) {
618 for (++it; it !=
end; ++
it) {
656 return d.stringdata +
d.data[handle];
666 return d.stringdata +
d.data[handle + 1];
676 return d.stringdata +
d.data[handle + 2];
686 return reinterpret_cast<const int*
>(
d.data +
d.data[handle + 3]);
696 return reinterpret_cast<const int*
>(
d.data +
d.data[handle + 4]);
706 return d.data[handle + 1];
void truncate(int pos)
Truncates the byte array at index position pos.
#define QT_END_NAMESPACE
This macro expands to.
QString name
The method's name.
QString name
The property's name.
Arguments outputArgs
A list of the signal's arguments.
Information about one property.
#define it(className, varName)
static Interfaces parseInterfaces(const QString &xml)
Parses the XML document fragment (given by xml) containing several interfaces.
QByteArray & append(char c)
Appends the character ch to this byte array.
Annotations annotations
The annotations associated with the method.
One argument to a D-Bus method or signal.
Signals signals_
The signals available in this interface.
QString & replace(int i, int len, QChar after)
The QByteArray class provides an array of bytes.
The QDBusError class represents an error received from the D-Bus bus or from remote applications foun...
static const QMetaObject staticMetaObject
This variable stores the meta-object for the class.
bool startsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string starts with s; otherwise returns false.
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
int count(const T &t) const
Returns the number of occurrences of value in the list.
The QString class provides a Unicode character string.
The QHash class is a template class that provides a hash-table-based dictionary.
Properties properties
The properties available in this interface.
QByteArray toHex() const
Returns a hex encoded copy of the byte array.
static const char * typeToName(Type type)
Converts the enum representation of the storage type, typ, to its string representation.
const T value(const Key &key) const
Returns the value associated with the key.
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
QMap< Key, T > & unite(const QMap< Key, T > &other)
Inserts all the items in the other map into this map.
Arguments outputArgs
A list of the method's output arguments (i.
QString name
The interface's name.
#define QT_BEGIN_NAMESPACE
This macro expands to.
Arguments inputArgs
A list of the method's input arguments.
const_iterator ConstIterator
Qt-style synonym for QMap::const_iterator.
#define ANNOTATION_NO_WAIT
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
const T value(const Key &key) const
Returns the value associated with the key key.
const T & at(int i) const
Returns the item at index position i in the list.
Annotations annotations
The annotations associated with the signal.
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
Type
This enum type defines the types of variable that a QVariant can contain.
QByteArray toLatin1() const Q_REQUIRED_RESULT
Returns a Latin-1 representation of the string as a QByteArray.
QString type
The argument type.
const_iterator constBegin() const
Returns a const STL-style iterator pointing to the first item in the map.
Information about one signal.
Annotations annotations
The annotations associated with the interface.
QString introspection
The XML document fragment describing this interface.
int length() const
Same as size().
static QByteArray prototype(const QList< QByteArray > ¶meterTypes, const QList< QByteArray > ¶meterNames, bool *ok)
The QMap::const_iterator class provides an STL-style const iterator for QMap and QMultiMap.
const_iterator constEnd() const
Returns a const STL-style iterator pointing to the imaginary item after the last item in the map...
QString arg(qlonglong a, int fieldwidth=0, int base=10, const QChar &fillChar=QLatin1Char(' ')) const Q_REQUIRED_RESULT
QString name
The argument name.
void clear()
Clears the contents of the string and makes it empty.
QString type
The property's type.
Methods methods
The methods available in this interface.
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
Information about one interface on the bus.
bool isEmpty() const
Returns true if the map contains no items; otherwise returns false.
QString name
The signal's name.
bool isEmpty() const
Returns true if the byte array has size 0; otherwise returns false.
Access access
The property's access rights.
void reserve(int size)
Attempts to allocate memory for at least size bytes.
static Type nameToType(const char *name)
Converts the string representation of the storage type given in name, to its enum representation...
static const KeyPair *const end
Annotations annotations
The annotations associated with the property.
Information about one method.
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
The QMap class is a template class that provides a skip-list-based dictionary.
Qt::LayoutDirection direction