diff options
author | Treeki <treeki@gmail.com> | 2010-10-14 20:17:20 +0200 |
---|---|---|
committer | Treeki <treeki@gmail.com> | 2010-10-14 20:17:20 +0200 |
commit | ebcc95da4c26369511caa90d89c5ed06e1e4853a (patch) | |
tree | 6ed445f0204a6e6615088d135c4b29c4309077a4 /lyt/pane.cpp | |
parent | fdf8cfec2b795393d7ee901abaf747575067068b (diff) | |
download | LayoutStudio-ebcc95da4c26369511caa90d89c5ed06e1e4853a.tar.gz LayoutStudio-ebcc95da4c26369511caa90d89c5ed06e1e4853a.zip |
brlyt packing added, plus some changes in the existing API (mostly for const correctness). brlyt writing may still need some testing (especially for the material structs)
Diffstat (limited to '')
-rw-r--r-- | lyt/pane.cpp | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/lyt/pane.cpp b/lyt/pane.cpp index bcba81b..7ae768a 100644 --- a/lyt/pane.cpp +++ b/lyt/pane.cpp @@ -27,7 +27,7 @@ LYTPane::~LYTPane() { delete ptr; } -LYTPane *LYTPane::findPaneByName(QString name, bool recursive) { +LYTPane *LYTPane::findPaneByName(QString name, bool recursive) const { foreach (LYTPane *pane, this->children) { if (pane->name == name) return pane; @@ -47,7 +47,11 @@ LYTLayout &LYTPane::layout() const { } -void LYTPane::dumpToDebug(bool showHeading) { +Magic LYTPane::magic() const { + return Magic('pan1'); +} + +void LYTPane::dumpToDebug(bool showHeading) const { if (showHeading) qDebug() << "LYTPane" << name << "@" << (void*)this; @@ -61,11 +65,11 @@ void LYTPane::dumpToDebug(bool showHeading) { -void LYTPane::writeToDataStream(QDataStream &out) { +void LYTPane::writeToDataStream(QDataStream &out) const { out << (quint8)flags; out << (quint8)origin; out << (quint8)alpha; - out.skipRawData(1); // padding + WritePadding(1, out); WriteFixedLengthASCII(out, name, 0x10); WriteFixedLengthASCII(out, userdata, 8); @@ -102,3 +106,12 @@ void LYTPane::readFromDataStream(QDataStream &in) { in >> (float&)width; in >> (float&)height; } + + +void LYTPane::addFontRefsToList(QStringList &list) const { + //qDebug() << "Getting font refs for" << this->name; + + foreach (LYTPane *p, this->children) { + p->addFontRefsToList(list); + } +} |