diff options
| author | Robert Bieber <robby@bieberphoto.com> | 2010-07-16 20:47:23 +0000 |
|---|---|---|
| committer | Robert Bieber <robby@bieberphoto.com> | 2010-07-16 20:47:23 +0000 |
| commit | 025147effbee00db8bae931b3ef3df25052e0d96 (patch) | |
| tree | db2df79d33b48f115fa35ffd9ae24f97c2bdc28b /utils/themeeditor/models/targetdata.h | |
| parent | 1c1d10b9fdfc2b78c5aeba4c352cd7dbc0717edc (diff) | |
| download | rockbox-025147effbee00db8bae931b3ef3df25052e0d96.zip rockbox-025147effbee00db8bae931b3ef3df25052e0d96.tar.gz rockbox-025147effbee00db8bae931b3ef3df25052e0d96.tar.bz2 rockbox-025147effbee00db8bae931b3ef3df25052e0d96.tar.xz | |
Theme Editor: Added target database, now populates combo box in new project dialog but otherwise not used yet
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27450 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'utils/themeeditor/models/targetdata.h')
| -rw-r--r-- | utils/themeeditor/models/targetdata.h | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/utils/themeeditor/models/targetdata.h b/utils/themeeditor/models/targetdata.h new file mode 100644 index 0000000..6178509 --- /dev/null +++ b/utils/themeeditor/models/targetdata.h @@ -0,0 +1,80 @@ +/*************************************************************************** + * __________ __ ___. + * 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 TARGETDATA_H +#define TARGETDATA_H + +#include <QFile> +#include <QString> +#include <QHash> +#include <QRect> + +class TargetData +{ + +public: + enum ScreenDepth + { + RGB, + Grey, + Mono, + None + }; + + TargetData(QString file = ""); + virtual ~TargetData(); + + int count(){ return indices.count(); } + int index(QString id){ return indices.value(id, -1); } + + QString id(int index){ return indices.key(index, ""); } + QString name(int index){ return entries[index].name; } + +private: + struct Entry + { + Entry(QString name, QRect size, ScreenDepth depth, QRect rSize, + ScreenDepth rDepth, bool fm) + : name(name), size(size), depth(depth), rSize(rSize), + rDepth(rDepth), fm(fm){ } + + QString name; + QRect size; + ScreenDepth depth; + QRect rSize; + ScreenDepth rDepth; + bool fm; + }; + + static const QString reserved; + + QString scanString(QString data, int& index); + int scanInt(QString data, int& index); + ScreenDepth scanDepth(QString data, int& index); + void skipComment(QString data, int& index); + bool require(QChar required, QString data, int& index); + + QHash<QString, int> indices; + QList<Entry> entries; + +}; + +#endif // TARGETDATA_H |