summaryrefslogtreecommitdiff
path: root/lyt/pane.cpp
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2010-10-14 20:17:20 +0200
committerTreeki <treeki@gmail.com>2010-10-14 20:17:20 +0200
commitebcc95da4c26369511caa90d89c5ed06e1e4853a (patch)
tree6ed445f0204a6e6615088d135c4b29c4309077a4 /lyt/pane.cpp
parentfdf8cfec2b795393d7ee901abaf747575067068b (diff)
downloadLayoutStudio-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.cpp21
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);
+ }
+}