summaryrefslogtreecommitdiffstats
path: root/utils/themeeditor/graphics
diff options
context:
space:
mode:
authorRobert Bieber <robby@bieberphoto.com>2010-06-23 20:18:31 +0000
committerRobert Bieber <robby@bieberphoto.com>2010-06-23 20:18:31 +0000
commit6d6156603cf2ac5facf08734f12e0b4d0c1fcce0 (patch)
tree25340c9fdac15f4bf88d7f6e5bd935d1f1934211 /utils/themeeditor/graphics
parent168eba1aecddc21231d922608380fe811a8a0473 (diff)
downloadrockbox-6d6156603cf2ac5facf08734f12e0b4d0c1fcce0.tar.gz
rockbox-6d6156603cf2ac5facf08734f12e0b4d0c1fcce0.zip
Theme Editor: Added dummy font class and implemented font load tag
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27096 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'utils/themeeditor/graphics')
-rw-r--r--utils/themeeditor/graphics/rbfont.cpp30
-rw-r--r--utils/themeeditor/graphics/rbfont.h38
-rw-r--r--utils/themeeditor/graphics/rbscreen.cpp22
-rw-r--r--utils/themeeditor/graphics/rbscreen.h5
4 files changed, 95 insertions, 0 deletions
diff --git a/utils/themeeditor/graphics/rbfont.cpp b/utils/themeeditor/graphics/rbfont.cpp
new file mode 100644
index 0000000000..48e0f304be
--- /dev/null
+++ b/utils/themeeditor/graphics/rbfont.cpp
@@ -0,0 +1,30 @@
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ * $Id$
+ *
+ * Copyright (C) 2010 Robert Bieber
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ****************************************************************************/
+
+#include "rbfont.h"
+
+RBFont::RBFont(QString file): filename(file)
+{
+}
+
+RBFont::~RBFont()
+{
+}
diff --git a/utils/themeeditor/graphics/rbfont.h b/utils/themeeditor/graphics/rbfont.h
new file mode 100644
index 0000000000..a1d66f22d4
--- /dev/null
+++ b/utils/themeeditor/graphics/rbfont.h
@@ -0,0 +1,38 @@
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ * $Id$
+ *
+ * Copyright (C) 2010 Robert Bieber
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ****************************************************************************/
+
+#ifndef RBFONT_H
+#define RBFONT_H
+
+#include <QString>
+#include <QFile>
+
+class RBFont
+{
+public:
+ RBFont(QString file);
+ virtual ~RBFont();
+
+private:
+ QString filename;
+};
+
+#endif // RBFONT_H
diff --git a/utils/themeeditor/graphics/rbscreen.cpp b/utils/themeeditor/graphics/rbscreen.cpp
index 004d2e0990..a090c2f9f2 100644
--- a/utils/themeeditor/graphics/rbscreen.cpp
+++ b/utils/themeeditor/graphics/rbscreen.cpp
@@ -67,6 +67,11 @@ RBScreen::~RBScreen()
{
if(backdrop)
delete backdrop;
+
+ QMap<int, RBFont*>::iterator i;
+ for(i = fonts.begin(); i != fonts.end(); i++)
+ if(*i)
+ delete (*i);
}
QPainterPath RBScreen::shape() const
@@ -103,6 +108,23 @@ void RBScreen::showViewport(QString name)
update();
}
+void RBScreen::loadFont(int id, RBFont* font)
+{
+ if(id < 2 || id > 9)
+ return;
+
+ fonts.insert(id, font);
+}
+
+RBFont* RBScreen::getFont(int id)
+{
+ if(fonts.value(id, 0) != 0)
+ return fonts.value(id);
+ else
+ return fonts.value(0, 0);
+}
+
+
void RBScreen::setBackdrop(QString filename)
{
diff --git a/utils/themeeditor/graphics/rbscreen.h b/utils/themeeditor/graphics/rbscreen.h
index 51fa32cee3..95a110a4d5 100644
--- a/utils/themeeditor/graphics/rbscreen.h
+++ b/utils/themeeditor/graphics/rbscreen.h
@@ -27,6 +27,7 @@
#include "projectmodel.h"
#include "rbrenderinfo.h"
#include "rbimage.h"
+#include "rbfont.h"
class RBViewport;
@@ -58,6 +59,9 @@ public:
}
RBImage* getImage(QString name){ return images.value(name, 0); }
+ void loadFont(int id, RBFont* font);
+ RBFont* getFont(int id);
+
void setBackdrop(QString filename);
void makeCustomUI(QString id);
@@ -77,6 +81,7 @@ private:
QMap<QString, RBViewport*> namedViewports;
QMap<QString, RBImage*> images;
QMap<QString, QString>* settings;
+ QMap<int, RBFont*> fonts;
};