summaryrefslogtreecommitdiff
path: root/lyt/layout.h
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2010-10-07 15:56:13 +0200
committerTreeki <treeki@gmail.com>2010-10-07 15:56:13 +0200
commit5f6dad55d75cbe146ff7fefc899a02ccd39078ba (patch)
tree0822df14cc6d2c0329810c9ae7b4a4a638fe82b1 /lyt/layout.h
downloadLayoutStudio-5f6dad55d75cbe146ff7fefc899a02ccd39078ba.tar.gz
LayoutStudio-5f6dad55d75cbe146ff7fefc899a02ccd39078ba.zip
initial commit -- everything compiles except for material.cpp. the material system still needs quite a bit of work; this will come in due time
Diffstat (limited to 'lyt/layout.h')
-rw-r--r--lyt/layout.h67
1 files changed, 67 insertions, 0 deletions
diff --git a/lyt/layout.h b/lyt/layout.h
new file mode 100644
index 0000000..2af32a1
--- /dev/null
+++ b/lyt/layout.h
@@ -0,0 +1,67 @@
+#ifndef LYTLAYOUT_H
+#define LYTLAYOUT_H
+
+#include "packagebase.h"
+#include "materials/material.h"
+#include "group.h"
+#include "pane.h"
+#include "textbox.h"
+#include "picture.h"
+#include "window.h"
+#include "bounding.h"
+#include "binaryfile.h"
+#include "binaryfilesection.h"
+
+#include <QtCore/QStringList>
+#include <QtCore/QMap>
+#include <QtCore/QDataStream>
+
+class LYTTexMap; // forward declaration so it can be a friend class
+
+class LYTLayout {
+public:
+ LYTLayout(LYTPackageBase &package);
+ LYTLayout(LYTPackageBase &package, QString name);
+ ~LYTLayout();
+
+ void clear();
+ LYTPackageBase &package() const;
+
+ float width;
+ float height;
+
+ QMap<QString, LYTMaterial *> materials;
+
+ LYTPane *rootPane;
+ QList<LYTGroup *> groups;
+
+
+
+protected:
+ LYTPackageBase &m_package;
+
+ // these are private because they are not intended for public use
+ // they're only here so that LYTPane's subclasses and a few others can read
+ // this info when reading/writing -- hence why they are friend classes
+ QStringList m_fontRefs;
+ QStringList m_textureRefs;
+
+ bool loadLayoutFromPackage(QString name);
+
+ void readLyt1(LYTBinaryFileSection &section);
+ void readTxl1(LYTBinaryFileSection &section);
+ void readFnl1(LYTBinaryFileSection &section);
+ void readMat1(LYTBinaryFileSection &section);
+
+ LYTPane *createPaneObj(LYTBinaryFileSection &section);
+
+ friend class LYTPane;
+ friend class LYTTextBox;
+ friend class LYTPicture;
+ friend class LYTWindow;
+ friend class LYTBounding;
+ friend class LYTTexMap;
+
+};
+
+#endif // LYTLAYOUT_H