[fondue-commits] [SCM] Fondue Font Editor branch, master, updated. 586b64ac89e9a0dd619ef83c8955b3c6e81fa745

Eugeniy Meshcheryakov eugen at debian.org
Sun Nov 4 15:49:00 UTC 2007


The branch, master has been updated
       via  586b64ac89e9a0dd619ef83c8955b3c6e81fa745 (commit)
       via  32b0252f8cdcecb60f79dc47249cb48d98e2aab3 (commit)
       via  08793cee894cc071ab1dafb2e9d62d0c9c0de276 (commit)
       via  538b898451294cf9a70a6e5789e6ca46e0a1344c (commit)
       via  a1651d7629f8443155fbed90fbc7ef5f9665efeb (commit)
       via  299a909f99d6d404de75192dafb2ddfc50452987 (commit)
       via  4c6efc6b0213f47860ebd229a42d7250de43bf6b (commit)
       via  9c75d67ac9536e1ac9c878104b119f5be13dbe41 (commit)
       via  4ec62effed9d1d9f8ef5f2b9a744258b75a8b3bc (commit)
       via  1d461af6207440ea32edef7e88ece51d7b66adce (commit)
       via  a7290bc650bc3c8420fe4b7563c1189901f6607e (commit)
       via  86afb263dcb86cd1e57afa1a5cde3d5e1704a648 (commit)
       via  2b13b88f0b0ad5e5cfb31fdfb1a41fb93c495c5d (commit)
       via  111183234dac72970476f21387a3c35ca342abd8 (commit)
      from  15dc29fdd28eaab758c831e64aa615e54f82f5d8 (commit)


- Shortlog ------------------------------------------------------------
586b64a remove files for MAXPModel class (obsoleted by DocumentInfoModel)
32b0252 use DocumentInfoModel in MAXPEditor (instead of MAXPModel)
08793ce add write support for DocumentInfoModel
538b898 create QDataWidgetMapper with parent in class TTIEditor
a1651d7 add Q_OBJECT to all QObjects that do not have it allready
299a909 reenable prep and fpgm editor
4c6efc6 new class DocumentInfoEditor - dialog for editing font information
9c75d67 new class DocumentInfoModel
4ec62ef emit signals when parts of FontDocument change
1d461af cleanup glyph.h
a7290bc declare properties of FontDocument class
86afb26 move all inline functions for FontDocument class into cxx file
2b13b88 remove unused signal GlyphsModel::glyphOutlineChanged()
1111832 remove unused signal GlyphsModel::glyphPointMoved()

Summary of changes:
 gui/documentinfoeditor.cxx   |   58 ++++++++
 gui/documentinfoeditor.h     |   30 ++++
 gui/glyphsmodel.h            |    3 -
 gui/gui.rules                |    9 +-
 gui/mainwindow.cxx           |   41 ++++--
 gui/mainwindow.h             |    8 +-
 gui/maxpeditor.cxx           |   14 +-
 gui/ttieditor.cxx            |    2 +-
 nongui/cvtmodel.h            |    1 +
 nongui/documentinfomodel.cxx |  193 +++++++++++++++++++++++++++
 nongui/documentinfomodel.h   |   72 ++++++++++
 nongui/fontdocument.cxx      |  303 +++++++++++++++++++++++++++++++++++++++--
 nongui/fontdocument.h        |  169 ++++++++++++-----------
 nongui/glyph.cxx             |  141 +++++++++++++++++++-
 nongui/glyph.h               |   85 +++----------
 nongui/maxpmodel.cxx         |   91 -------------
 nongui/maxpmodel.h           |   34 -----
 nongui/nongui.rules          |   12 +-
 18 files changed, 939 insertions(+), 327 deletions(-)
-----------------------------------------------------------------------
Details of changes:

commit 586b64ac89e9a0dd619ef83c8955b3c6e81fa745
Author: Eugeniy Meshcheryakov <eugen at debian.org>
Date:   Sun Nov 4 03:27:51 2007 +0100

    remove files for MAXPModel class (obsoleted by DocumentInfoModel)

diff --git a/nongui/maxpmodel.cxx b/nongui/maxpmodel.cxx
deleted file mode 100644
index 0001373..0000000
--- a/nongui/maxpmodel.cxx
+++ /dev/null
@@ -1,91 +0,0 @@
-/* Copyright (C) 2007 Євгеній Мещеряков <eugen at debian.org>
- *
- * 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 program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
- */
-#include "maxpmodel.h"
-#include "fontdocument.h"
-
-MAXPModel::MAXPModel(FontDocument *doc, QObject *parent) : QAbstractListModel(parent), m_doc(doc)
-{
-	Q_ASSERT(m_doc);
-}
-
-int MAXPModel::rowCount(const QModelIndex &parent) const
-{
-	if (parent.isValid())
-		return 0;
-	return NRows;
-}
-
-QVariant MAXPModel::data(const QModelIndex &index, int role) const
-{
-	if (!index.isValid() || index.column() != 0)
-		return QVariant();
-	if (role == Qt::DisplayRole || role == Qt::EditRole) {
-		switch (index.row()) {
-		case ZonesRow:
-			return m_doc->zonesCount();
-		case TwilightPointsRow:
-			return m_doc->maxTwilightPoints();
-		case StorageRow:
-			return m_doc->maxStorage();
-		case FDEFsRow:
-			return m_doc->maxFDEFs();
-		case IDEFsRow:
-			return m_doc->maxIDEFs();
-		case MaxStackRow:
-			return m_doc->maxStackDepth();
-		default:
-			return QVariant();
-		}
-	}
-	return QVariant();
-}
-
-bool MAXPModel::setData(const QModelIndex &index, const QVariant &value, int role)
-{
-	if (!index.isValid() || index.column() != 0)
-		return false;
-
-	bool ret = false;
-
-	if (role == Qt::EditRole) {
-		switch (index.row()) {
-		case ZonesRow:
-			ret = m_doc->setZonesCount(value.toUInt());
-			break;
-		case TwilightPointsRow:
-			ret = m_doc->setMaxTwilightPoints(value.toUInt());
-			break;
-		case StorageRow:
-			ret = m_doc->setMaxStorage(value.toUInt());
-			break;
-		case FDEFsRow:
-			ret = m_doc->setMaxFDEFs(value.toUInt());
-			break;
-		case IDEFsRow:
-			ret = m_doc->setMaxIDEFs(value.toUInt());
-			break;
-		case MaxStackRow:
-			ret = m_doc->setMaxStackDepth(value.toUInt());
-			break;
-		default:
-			break;
-		}
-		if (ret)
-			emit dataChanged(index, index);
-	}
-	return ret;
-}
diff --git a/nongui/maxpmodel.h b/nongui/maxpmodel.h
deleted file mode 100644
index 8de99af..0000000
--- a/nongui/maxpmodel.h
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Copyright (C) 2007 Євгеній Мещеряков <eugen at debian.org>
- *
- * 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 program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
- */
-#ifndef MAXPMODEL_H
-#define MAXPMODEL_H
-#include <QAbstractListModel>
-
-class FontDocument;
-
-class MAXPModel : public QAbstractListModel {
-	Q_OBJECT
-public:
-	enum {ZonesRow, TwilightPointsRow, StorageRow, FDEFsRow, IDEFsRow, MaxStackRow, NRows};
-	MAXPModel(FontDocument *doc, QObject *parent = 0);
-	int rowCount(const QModelIndex &parent = QModelIndex()) const;
-	QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
-	bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
-private:
-	FontDocument *m_doc;
-};
-
-#endif
diff --git a/nongui/nongui.rules b/nongui/nongui.rules
index 5b2da34..4cd09d6 100644
--- a/nongui/nongui.rules
+++ b/nongui/nongui.rules
@@ -9,7 +9,6 @@ libfonduenongui_a_SOURCES =		\
 	nongui/cvtmodel.cxx		\
 	nongui/ttfwriter.cxx		\
 	nongui/glyph.cxx		\
-	nongui/maxpmodel.cxx		\
 	nongui/unicodenameslist.cxx	\
 	nongui/documentinfomodel.cxx
 
@@ -20,8 +19,7 @@ nodist_libfonduenongui_a_SOURCES = 		\
 	nongui/encodertable.tbl.cxx		\
 	nongui/unicodenameslist.awked.cxx	\
 	nongui/documentinfomodel.moc.cxx	\
-	nongui/cvtmodel.moc.cxx			\
-	nongui/maxpmodel.moc.cxx
+	nongui/cvtmodel.moc.cxx
 
 nongui/decodertable.tbl.cxx: data/instructions.xml
 nongui/decodertable.tbl.cxx: DATAFILE=$(srcdir)/data/instructions.xml
@@ -52,7 +50,6 @@ noinst_HEADERS +=			\
 	nongui/ttfencode.h		\
 	nongui/cvtmodel.h		\
 	nongui/ttfwriter.h		\
-	nongui/maxpmodel.h		\
 	nongui/unicodenameslist.h	\
 	nongui/documentinfomodel.h
 

commit 32b0252f8cdcecb60f79dc47249cb48d98e2aab3
Author: Eugeniy Meshcheryakov <eugen at debian.org>
Date:   Sun Nov 4 03:24:10 2007 +0100

    use DocumentInfoModel in MAXPEditor (instead of MAXPModel)

diff --git a/gui/mainwindow.cxx b/gui/mainwindow.cxx
index 2b9df2d..c6ff03d 100644
--- a/gui/mainwindow.cxx
+++ b/gui/mainwindow.cxx
@@ -36,7 +36,6 @@
 #include "cvteditor.h"
 #include "ttfwriter.h"
 #include "maxpeditor.h"
-#include "maxpmodel.h"
 #include "documentinfomodel.h"
 #include "documentinfoeditor.h"
 
@@ -219,7 +218,6 @@ void MainWindow::setupModels()
 
 	documentInfoModel = new DocumentInfoModel(m_doc, this);
 	cvtModel = new CVTModel(m_doc, this);
-	maxpModel = new MAXPModel(m_doc, this);
 }
 
 void MainWindow::changeDocumentName(const QString &name)
@@ -376,7 +374,7 @@ void MainWindow::editCvt()
 
 void MainWindow::editMaxp()
 {
-	MAXPEditor *editor = new MAXPEditor(maxpModel, this);
+	MAXPEditor *editor = new MAXPEditor(documentInfoModel, this);
 	editor->setWindowTitle(QString("MAXP in %1").arg(m_doc->fontName()));
 	editor->show();
 }
diff --git a/gui/mainwindow.h b/gui/mainwindow.h
index 0ea2982..dd0ebb3 100644
--- a/gui/mainwindow.h
+++ b/gui/mainwindow.h
@@ -29,7 +29,6 @@ class QActionGroup;
 class UnicodeProxyModel;
 class DocumentInfoModel;
 class CVTModel;
-class MAXPModel;
 
 class MainWindow: public QMainWindow {
 	Q_OBJECT
@@ -112,7 +111,6 @@ private:
 	UnicodeProxyModel *unicodeProxy;
 	DocumentInfoModel *documentInfoModel;
 	CVTModel *cvtModel;
-	MAXPModel *maxpModel;
 };
 
 #endif
diff --git a/gui/maxpeditor.cxx b/gui/maxpeditor.cxx
index d6ac432..a79c669 100644
--- a/gui/maxpeditor.cxx
+++ b/gui/maxpeditor.cxx
@@ -20,7 +20,7 @@
 #include <QSpinBox>
 #include <QDialogButtonBox>
 #include <QDataWidgetMapper>
-#include "maxpmodel.h"
+#include "documentinfomodel.h"
 
 MAXPEditor::MAXPEditor(QAbstractItemModel *model, QWidget *parent) : QDialog(parent)
 {
@@ -89,12 +89,12 @@ MAXPEditor::MAXPEditor(QAbstractItemModel *model, QWidget *parent) : QDialog(par
 	mapper->setModel(model);
 	mapper->setOrientation(Qt::Vertical);
 
-	mapper->addMapping(zonesEdit, MAXPModel::ZonesRow, "value");
-	mapper->addMapping(twilightPtsEdit, MAXPModel::TwilightPointsRow, "value");
-	mapper->addMapping(storageEdit, MAXPModel::StorageRow, "value");
-	mapper->addMapping(stackEdit, MAXPModel::MaxStackRow, "value");
-	mapper->addMapping(FDEFsEdit, MAXPModel::FDEFsRow, "value");
-	mapper->addMapping(IDEFsEdit, MAXPModel::IDEFsRow, "value");
+	mapper->addMapping(zonesEdit, DocumentInfoModel::ZonesCountRow, "value");
+	mapper->addMapping(twilightPtsEdit, DocumentInfoModel::MaxTwilightPointsRow, "value");
+	mapper->addMapping(storageEdit, DocumentInfoModel::MaxStorageRow, "value");
+	mapper->addMapping(stackEdit, DocumentInfoModel::MaxStackDepthRow, "value");
+	mapper->addMapping(FDEFsEdit, DocumentInfoModel::MaxFDEFsRow, "value");
+	mapper->addMapping(IDEFsEdit, DocumentInfoModel::MaxIDEFsRow, "value");
 
 	mapper->setSubmitPolicy(QDataWidgetMapper::ManualSubmit);
 	mapper->toFirst();

commit 08793cee894cc071ab1dafb2e9d62d0c9c0de276
Author: Eugeniy Meshcheryakov <eugen at debian.org>
Date:   Sun Nov 4 03:18:25 2007 +0100

    add write support for DocumentInfoModel

diff --git a/nongui/documentinfomodel.cxx b/nongui/documentinfomodel.cxx
index d07f2ce..aad14ca 100644
--- a/nongui/documentinfomodel.cxx
+++ b/nongui/documentinfomodel.cxx
@@ -51,7 +51,7 @@ int DocumentInfoModel::rowCount(const QModelIndex &parent) const
 QVariant DocumentInfoModel::data(const QModelIndex &index, int role) const
 {
 	if (!index.isValid() || (role != Qt::DisplayRole && role != Qt::EditRole)
-			|| index.column() != 0 || index.row() >= NRows)
+			|| index.column() != 0)
 		return QVariant();
 
 	switch (index.row()) {
@@ -96,6 +96,76 @@ QVariant DocumentInfoModel::data(const QModelIndex &index, int role) const
 	return QVariant();
 }
 
+bool DocumentInfoModel::setData(const QModelIndex &index, const QVariant &value, int role)
+{
+	if (!index.isValid() || index.column() != 0)
+		return false;
+
+	bool ret = false;
+
+	if (role == Qt::EditRole) {
+		ret = true;
+		switch (index.row()) {
+		case CopyrightRow:
+			m_doc->setCopyright(value.toString());
+			break;
+		case PrepRow:
+			m_doc->setPrep(value.toString());
+			break;
+		case FpgmRow:
+			m_doc->setFpgm(value.toString());
+			break;
+		case FontNameRow:
+			m_doc->setFontName(value.toString());
+			break;
+		case FontFamilyRow:
+			m_doc->setFontFamily(value.toString());
+			break;
+		case FontWeightRow:
+			m_doc->setFontWeight(value.toString());
+			break;
+		case AscentRow:
+			m_doc->setAscent(value.toDouble());
+			break;
+		case DescentRow:
+			m_doc->setDescent(value.toDouble());
+			break;
+		case ItalicAngleRow:
+			m_doc->setItalicAngle(value.toDouble());
+			break;
+		case UnderlinePositionRow:
+			m_doc->setUnderlinePosition(value.toDouble());
+			break;
+		case UnderlineThicknessRow:
+			m_doc->setUnderlineThickness(value.toDouble());
+			break;
+		case ZonesCountRow:
+			ret = m_doc->setZonesCount(value.toUInt());
+			break;
+		case MaxTwilightPointsRow:
+			ret = m_doc->setMaxTwilightPoints(value.toUInt());
+			break;
+		case MaxStorageRow:
+			ret = m_doc->setMaxStorage(value.toUInt());
+			break;
+		case MaxFDEFsRow:
+			ret = m_doc->setMaxFDEFs(value.toUInt());
+			break;
+		case MaxIDEFsRow:
+			ret = m_doc->setMaxIDEFs(value.toUInt());
+			break;
+		case MaxStackDepthRow:
+			ret = m_doc->setMaxStackDepth(value.toUInt());
+			break;
+		default:
+			ret = false;
+			break;
+		}
+	}
+
+	return ret;
+}
+
 #define DOCUMENT_CHANGE_SLOT(name)					\
 void DocumentInfoModel::document##name##Changed()			\
 {									\
diff --git a/nongui/documentinfomodel.h b/nongui/documentinfomodel.h
index 2082cb5..0e36884 100644
--- a/nongui/documentinfomodel.h
+++ b/nongui/documentinfomodel.h
@@ -46,6 +46,7 @@ public:
 	DocumentInfoModel(FontDocument *doc, QObject *parent = 0);
 	int rowCount(const QModelIndex &parent = QModelIndex()) const;
 	QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
+	bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
 private slots:
 	void documentCopyrightChanged();
 	void documentPrepChanged();

commit 538b898451294cf9a70a6e5789e6ca46e0a1344c
Author: Eugeniy Meshcheryakov <eugen at debian.org>
Date:   Sun Nov 4 02:58:34 2007 +0100

    create QDataWidgetMapper with parent in class TTIEditor

diff --git a/gui/ttieditor.cxx b/gui/ttieditor.cxx
index fcab5be..f3f1dbf 100644
--- a/gui/ttieditor.cxx
+++ b/gui/ttieditor.cxx
@@ -63,7 +63,7 @@ TTIEditor::TTIEditor(QAbstractItemModel *model, const QModelIndex &item, QWidget
 	connect(checkInstructionsButton, SIGNAL(clicked()),
 			this, SLOT(checkInstructions()));
 
-	mapper = new QDataWidgetMapper;
+	mapper = new QDataWidgetMapper(this);
 	mapper->setModel(model);
 	mapper->addMapping(textEditor, item.column(), "plainText");
 	mapper->setCurrentIndex(item.row());

commit a1651d7629f8443155fbed90fbc7ef5f9665efeb
Author: Eugeniy Meshcheryakov <eugen at debian.org>
Date:   Sun Nov 4 02:49:04 2007 +0100

    add Q_OBJECT to all QObjects that do not have it allready

diff --git a/nongui/cvtmodel.h b/nongui/cvtmodel.h
index 771a606..dc7493f 100644
--- a/nongui/cvtmodel.h
+++ b/nongui/cvtmodel.h
@@ -21,6 +21,7 @@
 class FontDocument;
 
 class CVTModel : public QAbstractTableModel {
+	Q_OBJECT
 public:
 	enum {ValueColumn, VariableColumn, CommentColumn, NColumns};
 	CVTModel(FontDocument *doc, QObject *parent = 0);
diff --git a/nongui/maxpmodel.h b/nongui/maxpmodel.h
index 353ee66..8de99af 100644
--- a/nongui/maxpmodel.h
+++ b/nongui/maxpmodel.h
@@ -21,6 +21,7 @@
 class FontDocument;
 
 class MAXPModel : public QAbstractListModel {
+	Q_OBJECT
 public:
 	enum {ZonesRow, TwilightPointsRow, StorageRow, FDEFsRow, IDEFsRow, MaxStackRow, NRows};
 	MAXPModel(FontDocument *doc, QObject *parent = 0);
diff --git a/nongui/nongui.rules b/nongui/nongui.rules
index 61e3a3e..5b2da34 100644
--- a/nongui/nongui.rules
+++ b/nongui/nongui.rules
@@ -19,7 +19,9 @@ nodist_libfonduenongui_a_SOURCES = 		\
 	nongui/fontdocument.moc.cxx		\
 	nongui/encodertable.tbl.cxx		\
 	nongui/unicodenameslist.awked.cxx	\
-	nongui/documentinfomodel.moc.cxx
+	nongui/documentinfomodel.moc.cxx	\
+	nongui/cvtmodel.moc.cxx			\
+	nongui/maxpmodel.moc.cxx
 
 nongui/decodertable.tbl.cxx: data/instructions.xml
 nongui/decodertable.tbl.cxx: DATAFILE=$(srcdir)/data/instructions.xml

commit 299a909f99d6d404de75192dafb2ddfc50452987
Author: Eugeniy Meshcheryakov <eugen at debian.org>
Date:   Sun Nov 4 01:59:13 2007 +0100

    reenable prep and fpgm editor

diff --git a/gui/mainwindow.cxx b/gui/mainwindow.cxx
index eca73a9..2b9df2d 100644
--- a/gui/mainwindow.cxx
+++ b/gui/mainwindow.cxx
@@ -335,10 +335,12 @@ void MainWindow::editDocumentInfo()
 
 void MainWindow::editPrep()
 {
-#if 0
 	Q_ASSERT(m_doc);
+	Q_ASSERT(documentInfoModel);
 
-	TTIEditor *editor = new TTIEditor(this);
+	QModelIndex prepIdx = documentInfoModel->index(DocumentInfoModel::PrepRow, 0);
+
+	TTIEditor *editor = new TTIEditor(documentInfoModel, prepIdx, this);
 	connect(this, SIGNAL(documentClosed()), editor, SLOT(close()));
 
 	if (!m_doc->fontName().isEmpty())
@@ -346,27 +348,23 @@ void MainWindow::editPrep()
 	else
 		editor->setWindowTitle("prep table");
 	editor->show();
-	editor->setText(m_doc->prep());
-	/* TODO get the text back to prep */
-#endif
-	// TODO
 }
 
 void MainWindow::editFpgm()
 {
-#if 0
 	Q_ASSERT(m_doc);
+	Q_ASSERT(documentInfoModel);
+
+	QModelIndex fpgmIdx = documentInfoModel->index(DocumentInfoModel::FpgmRow, 0);
+
+	TTIEditor *editor = new TTIEditor(documentInfoModel, fpgmIdx, this);
+	connect(this, SIGNAL(documentClosed()), editor, SLOT(close()));
 
-	TTIEditor *editor = new TTIEditor(this);
 	if (!m_doc->fontName().isEmpty())
 		editor->setWindowTitle(QString("fpgm table in %1").arg(m_doc->fontName()));
 	else
 		editor->setWindowTitle("fpgm table");
 	editor->show();
-	editor->setText(m_doc->fpgm());
-	/* TODO get the text back to fpgm */
-#endif
-	// TODO
 }
 
 void MainWindow::editCvt()

commit 4c6efc6b0213f47860ebd229a42d7250de43bf6b
Author: Eugeniy Meshcheryakov <eugen at debian.org>
Date:   Sun Nov 4 01:44:36 2007 +0100

    new class DocumentInfoEditor - dialog for editing font information

diff --git a/gui/documentinfoeditor.cxx b/gui/documentinfoeditor.cxx
new file mode 100644
index 0000000..90c5da7
--- /dev/null
+++ b/gui/documentinfoeditor.cxx
@@ -0,0 +1,58 @@
+/* Copyright (C) 2007 Євгеній Мещеряков <eugen at debian.org>
+ *
+ * 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 program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+ */
+#include "documentinfoeditor.h"
+#include <QGridLayout>
+#include <QTextEdit>
+#include <QDataWidgetMapper>
+#include "documentinfomodel.h"
+#include <QLineEdit>
+#include <QLabel>
+
+DocumentInfoEditor::DocumentInfoEditor(QAbstractItemModel *model, QWidget *parent) : QDialog(parent)
+{
+	Q_ASSERT(model);
+
+	setAttribute(Qt::WA_DeleteOnClose);
+
+	Qt::WindowFlags flags = windowFlags();
+	setWindowFlags(flags & ~Qt::Dialog | Qt::Window);
+
+	QTextEdit *copyrightEditor = new QTextEdit;
+	QLineEdit *fontNameEditor = new QLineEdit;
+	QLineEdit *fontFamilyEditor = new QLineEdit;
+	QLineEdit *fontWeightEditor = new QLineEdit;
+
+	QGridLayout *grid = new QGridLayout;
+	grid->addWidget(new QLabel("Font Name:"), 0, 0);
+	grid->addWidget(fontNameEditor, 0, 1);
+	grid->addWidget(new QLabel("Font Family:"), 1, 0);
+	grid->addWidget(fontFamilyEditor, 1, 1);
+	grid->addWidget(new QLabel("Weight:"), 2, 0);
+	grid->addWidget(fontWeightEditor, 2, 1);
+	grid->addWidget(copyrightEditor, 3, 0, 1, 2);
+
+	QDataWidgetMapper *mapper = new QDataWidgetMapper(this);
+	mapper->setModel(model);
+	mapper->setOrientation(Qt::Vertical);
+	mapper->addMapping(copyrightEditor, DocumentInfoModel::CopyrightRow, "plainText");
+	mapper->addMapping(fontNameEditor, DocumentInfoModel::FontNameRow);
+	mapper->addMapping(fontFamilyEditor, DocumentInfoModel::FontFamilyRow);
+	mapper->addMapping(fontWeightEditor, DocumentInfoModel::FontWeightRow);
+	mapper->setCurrentIndex(0);
+
+	setLayout(grid);
+}
diff --git a/gui/cvteditor.h b/gui/documentinfoeditor.h
similarity index 78%
copy from gui/cvteditor.h
copy to gui/documentinfoeditor.h
index 5e447d2..a73f4c2 100644
--- a/gui/cvteditor.h
+++ b/gui/documentinfoeditor.h
@@ -14,24 +14,17 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
  */
-#ifndef CVTEDITOR_H
-#define CVTEDITOR_H
+#ifndef DOCUMENTINFOEDITOR_H
+#define DOCUMENTINFOEDITOR_H
 #include <QDialog>
 
 class QAbstractItemModel;
-class QTableView;
 
-class CVTEditor : public QDialog
+class DocumentInfoEditor : public QDialog
 {
 	Q_OBJECT
 public:
-	CVTEditor(QAbstractItemModel *model, QWidget *parent = 0);
-public slots:
-	void addRow();
-	void removeRow();
-	void clearTable();
-private:
-	QTableView *table;
+	DocumentInfoEditor(QAbstractItemModel *model, QWidget *parent = 0);
 };
 
 #endif
diff --git a/gui/gui.rules b/gui/gui.rules
index e57baad..c56ef8d 100644
--- a/gui/gui.rules
+++ b/gui/gui.rules
@@ -18,7 +18,8 @@ libfonduegui_a_SOURCES =		\
 	gui/unicodeproxymodel.cxx	\
 	gui/cvteditor.cxx		\
 	gui/maxpeditor.cxx		\
-	gui/glyphitem.cxx
+	gui/glyphitem.cxx		\
+	gui/documentinfoeditor.cxx
 
 nodist_libfonduegui_a_SOURCES =			\
 	gui/ttihighlighter.moc.cxx		\
@@ -36,7 +37,8 @@ nodist_libfonduegui_a_SOURCES =			\
 	gui/unicodeproxymodel.moc.cxx		\
 	gui/cvteditor.moc.cxx			\
 	gui/maxpeditor.moc.cxx			\
-	gui/glyphgraphics.moc.cxx
+	gui/glyphgraphics.moc.cxx		\
+	gui/documentinfoeditor.moc.cxx
 
 gui/instnames.tbl.cxx: data/instructions.xml
 gui/instnames.tbl.cxx: DATAFILE=$(srcdir)/data/instructions.xml
@@ -61,7 +63,8 @@ noinst_HEADERS += 			\
 	gui/unicodeproxymodel.h		\
 	gui/cvteditor.h			\
 	gui/maxpeditor.h		\
-	gui/glyphitem.h
+	gui/glyphitem.h			\
+	gui/documentinfoeditor.h
 
 CLEANFILES += gui/*.moc.cxx gui/*.tbl.cxx
 EXTRA_DIST += gui/instnames.xsl
diff --git a/gui/mainwindow.cxx b/gui/mainwindow.cxx
index 9e91046..eca73a9 100644
--- a/gui/mainwindow.cxx
+++ b/gui/mainwindow.cxx
@@ -37,6 +37,8 @@
 #include "ttfwriter.h"
 #include "maxpeditor.h"
 #include "maxpmodel.h"
+#include "documentinfomodel.h"
+#include "documentinfoeditor.h"
 
 #include "config.h"
 
@@ -84,6 +86,9 @@ void MainWindow::createActions()
 	exportTTFAction = new QAction("Export As TTF...", this);
 	connect(exportTTFAction, SIGNAL(triggered()), this, SLOT(exportTTF()));
 
+	editDocumentInfoAction = new QAction("Document Info...", this);
+	connect(editDocumentInfoAction, SIGNAL(triggered()), this, SLOT(editDocumentInfo()));
+
 	cellSizeGroup = new QActionGroup(this);
 	for (int i = 0; i < 5; i++) {
 		int size = (i + 2) * 16;
@@ -112,6 +117,7 @@ void MainWindow::createActions()
 	saveAction->setEnabled(false);
 	saveAsAction->setEnabled(false);
 	exportTTFAction->setEnabled(false);
+	editDocumentInfoAction->setEnabled(false);
 	editPrepAction->setEnabled(false);
 	editFpgmAction->setEnabled(false);
 	editCvtAction->setEnabled(false);
@@ -120,6 +126,7 @@ void MainWindow::createActions()
 	connect(this, SIGNAL(documentAvailable(bool)), saveAction, SLOT(setEnabled(bool)));
 	connect(this, SIGNAL(documentAvailable(bool)), saveAsAction, SLOT(setEnabled(bool)));
 	connect(this, SIGNAL(documentAvailable(bool)), exportTTFAction, SLOT(setEnabled(bool)));
+	connect(this, SIGNAL(documentAvailable(bool)), editDocumentInfoAction, SLOT(setEnabled(bool)));
 	connect(this, SIGNAL(documentAvailable(bool)), editPrepAction, SLOT(setEnabled(bool)));
 	connect(this, SIGNAL(documentAvailable(bool)), editFpgmAction, SLOT(setEnabled(bool)));
 	connect(this, SIGNAL(documentAvailable(bool)), editCvtAction, SLOT(setEnabled(bool)));
@@ -137,6 +144,7 @@ void MainWindow::createMenus()
 	fileMenu->addAction(exitAction);
 
 	editMenu = menuBar()->addMenu("&Edit");
+	editMenu->addAction(editDocumentInfoAction);
 
 	viewMenu = menuBar()->addMenu("&View");
 	for (int i = 0; i < 5; i++)
@@ -209,6 +217,7 @@ void MainWindow::setupModels()
 	unicodeProxy = new UnicodeProxyModel(model);
 	unicodeProxy->setSourceModel(model);
 
+	documentInfoModel = new DocumentInfoModel(m_doc, this);
 	cvtModel = new CVTModel(m_doc, this);
 	maxpModel = new MAXPModel(m_doc, this);
 }
@@ -318,6 +327,12 @@ bool MainWindow::exportTTF()
 	return true;
 }
 
+void MainWindow::editDocumentInfo()
+{
+	DocumentInfoEditor *editor = new DocumentInfoEditor(documentInfoModel, this);
+	editor->show();
+}
+
 void MainWindow::editPrep()
 {
 #if 0
diff --git a/gui/mainwindow.h b/gui/mainwindow.h
index 8eec09f..0ea2982 100644
--- a/gui/mainwindow.h
+++ b/gui/mainwindow.h
@@ -27,6 +27,7 @@ class GlyphsModel;
 class QModelIndex;
 class QActionGroup;
 class UnicodeProxyModel;
+class DocumentInfoModel;
 class CVTModel;
 class MAXPModel;
 
@@ -45,6 +46,8 @@ public slots:
 	bool saveAs();
 	bool exportTTF();
 
+	void editDocumentInfo();
+
 	void editPrep();
 	void editFpgm();
 	void editCvt();
@@ -92,6 +95,8 @@ private:
 	QAction *saveAsAction;
 	QAction *exportTTFAction;
 
+	QAction *editDocumentInfoAction;
+
 	QActionGroup *cellSizeGroup;
 	QAction *cellSizeActions[5];
 
@@ -105,6 +110,7 @@ private:
 	GlyphsGridWidget *glyphsView;
 	GlyphsModel *model;
 	UnicodeProxyModel *unicodeProxy;
+	DocumentInfoModel *documentInfoModel;
 	CVTModel *cvtModel;
 	MAXPModel *maxpModel;
 };

commit 9c75d67ac9536e1ac9c878104b119f5be13dbe41
Author: Eugeniy Meshcheryakov <eugen at debian.org>
Date:   Sun Nov 4 01:35:02 2007 +0100

    new class DocumentInfoModel
    Contains read-only model of document (excluding glyphs)

diff --git a/nongui/documentinfomodel.cxx b/nongui/documentinfomodel.cxx
new file mode 100644
index 0000000..d07f2ce
--- /dev/null
+++ b/nongui/documentinfomodel.cxx
@@ -0,0 +1,123 @@
+/* Copyright (C) 2007 Євгеній Мещеряков <eugen at debian.org>
+ *
+ * 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 program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+ */
+#include "documentinfomodel.h"
+#include "fontdocument.h"
+#include <QDebug>
+
+DocumentInfoModel::DocumentInfoModel(FontDocument *doc, QObject *parent) :
+	QAbstractListModel(parent), m_doc(doc)
+{
+	Q_ASSERT(m_doc);
+	connect(m_doc, SIGNAL(copyrightChanged()), this, SLOT(documentCopyrightChanged()));
+	connect(m_doc, SIGNAL(prepChanged()), this, SLOT(documentPrepChanged()));
+	connect(m_doc, SIGNAL(fpgmChanged()), this, SLOT(documentFpgmChanged()));
+	connect(m_doc, SIGNAL(fontNameChanged()), this, SLOT(documentFontNameChanged()));
+	connect(m_doc, SIGNAL(fontFamilyChanged()), this, SLOT(documentFontFamilyChanged()));
+	connect(m_doc, SIGNAL(fontWeightChanged()), this, SLOT(documentFontWeightChanged()));
+	connect(m_doc, SIGNAL(ascentChanged()), this, SLOT(documentAscentChanged()));
+	connect(m_doc, SIGNAL(descentChanged()), this, SLOT(documentDescentChanged()));
+	connect(m_doc, SIGNAL(italicAngleChanged()), this, SLOT(documentItalicAngleChanged()));
+	connect(m_doc, SIGNAL(underlinePositionChanged()), this, SLOT(documentUnderlinePositionChanged()));
+	connect(m_doc, SIGNAL(underlineThicknessChanged()), this, SLOT(documentUnderlineThicknessChanged()));
+	connect(m_doc, SIGNAL(zonesCountChanged()), this, SLOT(documentZonesCountChanged()));
+	connect(m_doc, SIGNAL(maxTwilightPointsChanged()), this, SLOT(documentMaxTwilightPointsChanged()));
+	connect(m_doc, SIGNAL(maxStorageChanged()), this, SLOT(documentMaxStorageChanged()));
+	connect(m_doc, SIGNAL(maxFDEFsChanged()), this, SLOT(documentMaxFDEFsChanged()));
+	connect(m_doc, SIGNAL(maxIDEFsChanged()), this, SLOT(documentMaxIDEFsChanged()));
+	connect(m_doc, SIGNAL(maxStackDepthChanged()), this, SLOT(documentMaxStackDepthChanged()));
+}
+
+int DocumentInfoModel::rowCount(const QModelIndex &parent) const
+{
+	if (parent.isValid())
+		return 0;
+	return NRows;
+}
+
+QVariant DocumentInfoModel::data(const QModelIndex &index, int role) const
+{
+	if (!index.isValid() || (role != Qt::DisplayRole && role != Qt::EditRole)
+			|| index.column() != 0 || index.row() >= NRows)
+		return QVariant();
+
+	switch (index.row()) {
+	case CopyrightRow:
+		return m_doc->copyright();
+	case PrepRow:
+		return m_doc->prep();
+	case FpgmRow:
+		return m_doc->fpgm();
+	case FontNameRow:
+		return m_doc->fontName();
+	case FontFamilyRow:
+		return m_doc->fontFamily();
+	case FontWeightRow:
+		return m_doc->fontWeight();
+	case AscentRow:
+		return m_doc->ascent();
+	case DescentRow:
+		return m_doc->descent();
+	case ItalicAngleRow:
+		return m_doc->italicAngle();
+	case UnderlinePositionRow:
+		return m_doc->underlinePosition();
+	case UnderlineThicknessRow:
+		return m_doc->underlineThickness();
+	case ZonesCountRow:
+		return m_doc->zonesCount();
+	case MaxTwilightPointsRow:
+		return m_doc->maxTwilightPoints();
+	case MaxStorageRow:
+		return m_doc->maxStorage();
+	case MaxFDEFsRow:
+		return m_doc->maxFDEFs();
+	case MaxIDEFsRow:
+		return m_doc->maxIDEFs();
+	case MaxStackDepthRow:
+		return m_doc->maxStackDepth();
+	default:
+		break;
+	}
+
+	return QVariant();
+}
+
+#define DOCUMENT_CHANGE_SLOT(name)					\
+void DocumentInfoModel::document##name##Changed()			\
+{									\
+	QModelIndex idx = createIndex(name##Row, 0);			\
+	emit dataChanged(idx, idx);					\
+}
+
+DOCUMENT_CHANGE_SLOT(Copyright)
+DOCUMENT_CHANGE_SLOT(Prep)
+DOCUMENT_CHANGE_SLOT(Fpgm)
+DOCUMENT_CHANGE_SLOT(FontName)
+DOCUMENT_CHANGE_SLOT(FontFamily)
+DOCUMENT_CHANGE_SLOT(FontWeight)
+DOCUMENT_CHANGE_SLOT(Ascent)
+DOCUMENT_CHANGE_SLOT(Descent)
+DOCUMENT_CHANGE_SLOT(ItalicAngle)
+DOCUMENT_CHANGE_SLOT(UnderlinePosition)
+DOCUMENT_CHANGE_SLOT(UnderlineThickness)
+DOCUMENT_CHANGE_SLOT(ZonesCount)
+DOCUMENT_CHANGE_SLOT(MaxTwilightPoints)
+DOCUMENT_CHANGE_SLOT(MaxStorage)
+DOCUMENT_CHANGE_SLOT(MaxFDEFs)
+DOCUMENT_CHANGE_SLOT(MaxIDEFs)
+DOCUMENT_CHANGE_SLOT(MaxStackDepth)
+
diff --git a/nongui/documentinfomodel.h b/nongui/documentinfomodel.h
new file mode 100644
index 0000000..2082cb5
--- /dev/null
+++ b/nongui/documentinfomodel.h
@@ -0,0 +1,71 @@
+/* Copyright (C) 2007 Євгеній Мещеряков <eugen at debian.org>
+ *
+ * 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 program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+ */
+#ifndef DOCUMENTINFOMODEL_H
+#define DOCUMENTINFOMODEL_H
+#include <QAbstractListModel>
+
+class FontDocument;
+
+class DocumentInfoModel : public QAbstractListModel {
+	Q_OBJECT
+public:
+	enum {
+		CopyrightRow,
+		PrepRow,
+		FpgmRow,
+		FontNameRow,
+		FontFamilyRow,
+		FontWeightRow,
+		AscentRow,
+		DescentRow,
+		ItalicAngleRow,
+		UnderlinePositionRow,
+		UnderlineThicknessRow,
+		ZonesCountRow,
+		MaxTwilightPointsRow,
+		MaxStorageRow,
+		MaxFDEFsRow,
+		MaxIDEFsRow,
+		MaxStackDepthRow,
+		NRows
+	};
+	DocumentInfoModel(FontDocument *doc, QObject *parent = 0);
+	int rowCount(const QModelIndex &parent = QModelIndex()) const;
+	QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
+private slots:
+	void documentCopyrightChanged();
+	void documentPrepChanged();
+	void documentFpgmChanged();
+	void documentFontNameChanged();
+	void documentFontFamilyChanged();
+	void documentFontWeightChanged();
+	void documentAscentChanged();
+	void documentDescentChanged();
+	void documentItalicAngleChanged();
+	void documentUnderlinePositionChanged();
+	void documentUnderlineThicknessChanged();
+	void documentZonesCountChanged();
+	void documentMaxTwilightPointsChanged();
+	void documentMaxStorageChanged();
+	void documentMaxFDEFsChanged();
+	void documentMaxIDEFsChanged();
+	void documentMaxStackDepthChanged();
+private:
+	FontDocument *m_doc;
+};
+
+#endif
diff --git a/nongui/nongui.rules b/nongui/nongui.rules
index dd9ccfb..61e3a3e 100644
--- a/nongui/nongui.rules
+++ b/nongui/nongui.rules
@@ -10,14 +10,16 @@ libfonduenongui_a_SOURCES =		\
 	nongui/ttfwriter.cxx		\
 	nongui/glyph.cxx		\
 	nongui/maxpmodel.cxx		\
-	nongui/unicodenameslist.cxx
+	nongui/unicodenameslist.cxx	\
+	nongui/documentinfomodel.cxx
 
 nodist_libfonduenongui_a_SOURCES = 		\
 	nongui/decodertable.tbl.cxx		\
 	nongui/glyph.moc.cxx			\
 	nongui/fontdocument.moc.cxx		\
 	nongui/encodertable.tbl.cxx		\
-	nongui/unicodenameslist.awked.cxx
+	nongui/unicodenameslist.awked.cxx	\
+	nongui/documentinfomodel.moc.cxx
 
 nongui/decodertable.tbl.cxx: data/instructions.xml
 nongui/decodertable.tbl.cxx: DATAFILE=$(srcdir)/data/instructions.xml
@@ -49,7 +51,8 @@ noinst_HEADERS +=			\
 	nongui/cvtmodel.h		\
 	nongui/ttfwriter.h		\
 	nongui/maxpmodel.h		\
-	nongui/unicodenameslist.h
+	nongui/unicodenameslist.h	\
+	nongui/documentinfomodel.h
 
 EXTRA_DIST +=				\
 	nongui/decodertable.xsl		\

commit 4ec62effed9d1d9f8ef5f2b9a744258b75a8b3bc
Author: Eugeniy Meshcheryakov <eugen at debian.org>
Date:   Sun Nov 4 00:59:37 2007 +0100

    emit signals when parts of FontDocument change

diff --git a/nongui/fontdocument.cxx b/nongui/fontdocument.cxx
index 284d7e0..0d706fd 100644
--- a/nongui/fontdocument.cxx
+++ b/nongui/fontdocument.cxx
@@ -23,11 +23,39 @@ FontDocument::FontDocument(QObject *parent) : QObject(parent),
 {
 }
 
+template <typename T>
+static inline bool setIfChanged(T &what, const T &to)
+{
+	if (what != to) {
+		what = to;
+		return true;
+	}
+	return false;
+}
+
+template <>
+inline bool setIfChanged(QString &what, const QString &to)
+{
+	QString newVal;
+
+	// make empty strings null
+	if (!to.isEmpty())
+		newVal = to;
+	if (what != to) {
+		what = to;
+		return true;
+	}
+	return false;
+}
+
 /** Set copyright string for the font document.
  */
 void FontDocument::setCopyright(const QString &copyright)
 {
-	m_copyright = copyright;
+	if (setIfChanged(m_copyright, copyright)) {
+		emit copyrightChanged();
+		setChanged();
+	}
 }
 
 /** returns copyright string for the document.
@@ -42,7 +70,10 @@ QString FontDocument::copyright() const
  */
 void FontDocument::setPrep(const QString &data)
 {
-	m_prep = data;
+	if (setIfChanged(m_prep, data)) {
+		emit prepChanged();
+		setChanged();
+	}
 }
 
 /** Set content of TrueType font program table.
@@ -50,7 +81,10 @@ void FontDocument::setPrep(const QString &data)
  */
 void FontDocument::setFpgm(const QString &data)
 {
-	m_fpgm = data;
+	if (setIfChanged(m_fpgm, data)) {
+		emit fpgmChanged();
+		setChanged();
+	}
 }
 
 /** returns content of TrueType prep table.
@@ -149,7 +183,10 @@ Glyph *FontDocument::getGlyph(const QString &name)
 
 void FontDocument::setFontName(const QString &name)
 {
-	m_fontFace.fontName = name;
+	if (setIfChanged(m_fontFace.fontName, name)) {
+		emit fontNameChanged();
+		setChanged();
+	}
 }
 
 QString FontDocument::fontName() const
@@ -159,7 +196,10 @@ QString FontDocument::fontName() const
 
 void FontDocument::setFontFamily(const QString &name)
 {
-	m_fontFace.fontFamily = name;
+	if (setIfChanged(m_fontFace.fontFamily, name)) {
+		emit fontFamilyChanged();
+		setChanged();
+	}
 }
 
 QString FontDocument::fontFamily() const
@@ -169,7 +209,10 @@ QString FontDocument::fontFamily() const
 
 void FontDocument::setFontWeight(const QString &weight)
 {
-	m_fontFace.fontWeight = weight;
+	if (setIfChanged(m_fontFace.fontWeight, weight)) {
+		emit fontWeightChanged();
+		setChanged();
+	}
 }
 
 QString FontDocument::fontWeight() const
@@ -179,7 +222,10 @@ QString FontDocument::fontWeight() const
 
 void FontDocument::setAscent(qreal ascent)
 {
-	m_fontFace.ascent = ascent;
+	if (setIfChanged(m_fontFace.ascent, ascent)) {
+		emit ascentChanged();
+		setChanged();
+	}
 }
 
 qreal FontDocument::ascent() const
@@ -189,7 +235,10 @@ qreal FontDocument::ascent() const
 
 void FontDocument::setDescent(qreal descent)
 {
-	m_fontFace.descent = descent;
+	if (setIfChanged(m_fontFace.descent, descent)) {
+		emit descentChanged();
+		setChanged();
+	}
 }
 
 qreal FontDocument::descent() const
@@ -199,7 +248,10 @@ qreal FontDocument::descent() const
 
 void FontDocument::setItalicAngle(qreal italicAngle)
 {
-	m_fontFace.italicAngle = italicAngle;
+	if (setIfChanged(m_fontFace.italicAngle, italicAngle)) {
+		emit italicAngleChanged();
+		setChanged();
+	}
 }
 
 qreal FontDocument::italicAngle() const
@@ -209,7 +261,10 @@ qreal FontDocument::italicAngle() const
 
 void FontDocument::setUnderlinePosition(qreal underlinePosition)
 {
-	m_fontFace.underlinePosition = underlinePosition;
+	if (setIfChanged(m_fontFace.underlinePosition, underlinePosition)) {
+		emit underlinePositionChanged();
+		setChanged();
+	}
 }
 
 qreal FontDocument::underlinePosition() const
@@ -219,7 +274,10 @@ qreal FontDocument::underlinePosition() const
 
 void FontDocument::setUnderlineThickness(qreal underlineThickness)
 {
-	m_fontFace.underlineThickness = underlineThickness;
+	if (setIfChanged(m_fontFace.underlineThickness, underlineThickness)) {
+		emit underlineThicknessChanged();
+		setChanged();
+	}
 }
 
 qreal FontDocument::underlineThickness() const
@@ -229,10 +287,8 @@ qreal FontDocument::underlineThickness() const
 
 void FontDocument::setChanged(bool changed)
 {
-	if (changed != m_documentChanged) {
-		m_documentChanged = changed;
+	if (setIfChanged(m_documentChanged, changed))
 		emit documentChanged();
-	}
 }
 
 bool FontDocument::changed() const
@@ -345,8 +401,8 @@ bool FontDocument::setZonesCount(unsigned count)
 	// font can only have one or two zones
 	if (count != 1 && count != 2)
 		return false;
-	if (count != maxp.zonesCount) {
-		maxp.zonesCount = count;
+	if (setIfChanged(maxp.zonesCount, count)) {
+		emit zonesCountChanged();
 		setChanged();
 	}
 	return true;
@@ -361,8 +417,8 @@ bool FontDocument::setMaxTwilightPoints(unsigned count)
 {
 	if (count > 0xFFFF)
 		count = 0xFFFF;
-	if (maxp.maxTwilightPoints != count) {
-		maxp.maxTwilightPoints = count;
+	if (setIfChanged(maxp.maxTwilightPoints, count)) {
+		emit maxTwilightPointsChanged();
 		setChanged();
 	}
 	return true;
@@ -377,8 +433,8 @@ bool FontDocument::setMaxStorage(unsigned size)
 {
 	if (size > 0xFFFF)
 		size = 0xFFFF;
-	if (maxp.maxStorage != size) {
-		maxp.maxStorage = size;
+	if (setIfChanged(maxp.maxStorage, size)) {
+		emit maxStorageChanged();
 		setChanged();
 	}
 	return true;
@@ -393,8 +449,8 @@ bool FontDocument::setMaxFDEFs(unsigned count)
 {
 	if (count > 0xFFFF)
 		count = 0xFFFF;
-	if (maxp.maxFDEFs != count) {
-		maxp.maxFDEFs = count;
+	if (setIfChanged(maxp.maxFDEFs, count)) {
+		emit maxFDEFsChanged();
 		setChanged();
 	}
 	return true;
@@ -409,8 +465,8 @@ bool FontDocument::setMaxIDEFs(unsigned count)
 {
 	if (count > 0xFFFF)
 		count = 0xFFFF;
-	if (maxp.maxIDEFs != count) {
-		maxp.maxIDEFs = count;
+	if (setIfChanged(maxp.maxIDEFs, count)) {
+		emit maxIDEFsChanged();
 		setChanged();
 	}
 	return true;
@@ -425,8 +481,8 @@ bool FontDocument::setMaxStackDepth(unsigned depth)
 {
 	if (depth > 0xFFFF)
 		depth = 0xFFFF;
-	if (maxp.maxStackDepth != depth) {
-		maxp.maxStackDepth = depth;
+	if (setIfChanged(maxp.maxStackDepth, depth)) {
+		emit maxStackDepthChanged();
 		setChanged();
 	}
 	return true;
diff --git a/nongui/fontdocument.h b/nongui/fontdocument.h
index bf2212d..7251930 100644
--- a/nongui/fontdocument.h
+++ b/nongui/fontdocument.h
@@ -129,7 +129,25 @@ public:
 protected slots:
 	void glyphOutlineChanged(Glyph *g);
 signals:
+	void copyrightChanged();
+	void prepChanged();
+	void fpgmChanged();
+	void fontNameChanged();
+	void fontFamilyChanged();
+	void fontWeightChanged();
+	void ascentChanged();
+	void descentChanged();
+	void italicAngleChanged();
+	void underlinePositionChanged();
+	void underlineThicknessChanged();
 	void documentChanged();
+	void zonesCountChanged();
+	void maxTwilightPointsChanged();
+	void maxStorageChanged();
+	void maxFDEFsChanged();
+	void maxIDEFsChanged();
+	void maxStackDepthChanged();
+
 	void glyphChanged(int index);
 private:
 	class FontFace {

commit 1d461af6207440ea32edef7e88ece51d7b66adce
Author: Eugeniy Meshcheryakov <eugen at debian.org>
Date:   Sun Nov 4 00:02:39 2007 +0100

    cleanup glyph.h

diff --git a/nongui/glyph.cxx b/nongui/glyph.cxx
index 9539924..0ecdb8a 100644
--- a/nongui/glyph.cxx
+++ b/nongui/glyph.cxx
@@ -18,12 +18,151 @@
 #include "contour.h"
 #include "glyphref.h"
 
+/** Construct an empty glyph with given name.
+ * @param name a name for the new glyph.
+ */
+Glyph::Glyph(const QString &name) :
+	QObject(), horiz_adv_x_set(false), m_unicode(-1)
+{
+	setObjectName(name);
+}
+
+FontDocument *Glyph::document() const
+{
+	return qobject_cast<FontDocument *>(parent());
+}
+
+/** Set horizontal advance.
+ * This function sets horizontal advance for the glyph.
+ * @param adv a new value for horizontal advance
+ * @see unsetHorizAdvX(), hasHorizAdvX() and horizAdvX()
+ */
+void Glyph::setHorizAdvX(qreal adv)
+{
+	horiz_adv_x = adv;
+	horiz_adv_x_set = true;
+}
+
+/** Unset flag that indicates that horizontal advance was set for this glyph
+ * @sa setHorizAdvX(), hasHorizAdvX() and horizAdvX()
+ */
+void Glyph::unsetHorizAdvX()
+{
+	horiz_adv_x_set = false;
+}
+
+/** Check whether horizontal advence was set for this glyph
+ * @return true if horizontal advance was set
+ */
+bool Glyph::hasHorizAdvX() const
+{
+	return horiz_adv_x_set;
+}
+
+/** returns horizontal advance value. Result is undefined
+ * if \ref setHorizAdvX() was not called for this glyph.
+ * @sa setHorizAdvX(), unsetHorizAdvX() and hasHorizAdvX()
+ */
+qreal Glyph::horizAdvX() const
+{
+	return horiz_adv_x;
+}
+
+/** Set glyph instructions.
+ * This function sets TrueType instructions and validity flag.
+ * @param instructions a string containing TrueType instructions.
+ * @param valid instructions validity flag.
+ * @sa instructions()
+ */
+void Glyph::setInstructions(const QString &instructions, bool valid)
+{
+	m_instructions = instructions;
+	instructions_valid = valid;
+}
+
+/** return TrueType instructions for the glyph.
+ * @sa setInstructions()
+ */
+QString Glyph::instructions() const
+{
+	return m_instructions;
+}
+
+/** Query whether glyph has instructions.
+ * @return true if glyph contains instructions.
+ * @note This function only checks whether there is any instructions source text for
+ * this glyph; this text may still result in no instructions.
+ */
+bool Glyph::hasInstructions() const
+{
+	return !m_instructions.isNull();
+}
+
+/** Set validity flag for TrueType instructions.
+ * @sa instructionsAreValid()
+ */
+void Glyph::setInstructionsValidity(bool valid)
+{
+	instructions_valid = valid;
+}
+
+/** Returns validity flag for TrueType instructions.
+ * @sa hasInstructions()
+ */
+bool Glyph::instructionsAreValid() const
+{
+	return instructions_valid;
+}
+
+/** Set color string for the glyph.
+ * @param s new color string. It should be in format \#RRGGBB.
+ * @sa colorString()
+ */
+void Glyph::setColorString(const QString &s)
+{
+	m_colorString = s;
+}
+
+/** returns color string.
+ * @sa setColorString()
+ */
+QString Glyph::colorString() const
+{
+	return m_colorString;
+}
+
+/** Set comment string.
+ * @sa comment()
+ */
+void Glyph::setComment(const QString &s) 
+{
+	m_comment = s;
+}
+
+/** returns comment string
+ * @sa setComment()
+ */
+QString Glyph::comment() const
+{
+	return m_comment;
+}
+
+void Glyph::setUnicode(int u)
+{
+	m_unicode = u;
+}
+
+int Glyph::unicode() const
+{
+	return m_unicode;
+}
+
 bool Glyph::computeMetrics(qreal &xMin, qreal &xMax, qreal &yMin, qreal &yMax) const
 {
 	// TODO do something with open contours
 	if (content.isEmpty()) {
 		xMin = xMax = yMin = yMax = 0;
-		return false;
+	return false;
 	}
 	Contour c = content.at(0).value<Contour>();
 	if (c.isEmpty())
diff --git a/nongui/glyph.h b/nongui/glyph.h
index 2a3e5ab..fa19ef1 100644
--- a/nongui/glyph.h
+++ b/nongui/glyph.h
@@ -30,12 +30,9 @@ class FontDocument;
 class Glyph : public QObject {
 	Q_OBJECT
 public:
-	/** Construct an empty glyph with given name.
-	 * @param name a name for the new glyph.
-	 */
-	Glyph(const QString &name = QString()) : QObject() {setObjectName(name); horiz_adv_x_set = false; m_unicode = -1;}
+	Glyph(const QString &name = QString());
 
-	FontDocument *document() const {return qobject_cast<FontDocument *>(parent());}
+	FontDocument *document() const;
 	/** Glyph outlines.
 	 * This list holds all contours and references inside the glyph.
 	 * It can contain values of type \ref Contour or \ref GlyphRef.
@@ -43,73 +40,25 @@ public:
 	 */
 	QList<QVariant> content; // TODO hide it
 	
-	/** Set horizontal advance.
-	 * This function sets horizontal advance for the glyph.
-	 * @param adv a new value for horizontal advance
-	 * @see unsetHorizAdvX(), hasHorizAdvX() and horizAdvX()
-	 */
-	void setHorizAdvX(qreal adv) {horiz_adv_x = adv; horiz_adv_x_set = true;}
-	/** Unset flag that indicates that horizontal advance was set for this glyph
-	 * @sa setHorizAdvX(), hasHorizAdvX() and horizAdvX()
-	 */
-	void unsetHorizAdvX() {horiz_adv_x_set = false;}
-	/** Check whether horizontal advence was set for this glyph
-	 * @return true if horizontal advance was set
-	 */
-	bool hasHorizAdvX() const {return horiz_adv_x_set;}
-	/** returns horizontal advance value. Result is undefined
-	 * if \ref setHorizAdvX() was not called for this glyph.
-	 * @sa setHorizAdvX(), unsetHorizAdvX() and hasHorizAdvX()
-	 */
-	qreal horizAdvX() const {return horiz_adv_x;}
+	void setHorizAdvX(qreal adv);
+	void unsetHorizAdvX();
+	bool hasHorizAdvX() const;
+	qreal horizAdvX() const;
 
-	/** Set glyph instructions.
-	 * This function sets TrueType instructions and validity flag.
-	 * @param instructions a string containing TrueType instructions.
-	 * @param valid instructions validity flag.
-	 * @sa instructions()
-	 */
-	void setInstructions(const QString &instructions, bool valid = true) {m_instructions = instructions; instructions_valid = valid; }
-	/** return TrueType instructions for the glyph.
-	 * @sa setInstructions()
-	 */
-	const QString &instructions() const {return m_instructions;}
-	/** Query whether glyph has instructions.
-	 * @return true if glyph contains instructions.
-	 * @note This function only checks whether there is any instructions source text for
-	 * this glyph; this text may still result in no instructions.
-	 */
-	bool hasInstructions() const {return !m_instructions.isNull();}
-	/** Set validity flag for TrueType instructions.
-	 * @sa instructionsAreValid()
-	 */
-	void setInstructionsValidity(bool valid = true) {instructions_valid = valid;}
-	/** Returns validity flag for TrueType instructions.
-	 * @sa hasInstructions()
-	 */
-	bool instructionsAreValid() const {return instructions_valid;}
+	void setInstructions(const QString &instructions, bool valid = true);
+	QString instructions() const;
+	bool hasInstructions() const;
+	void setInstructionsValidity(bool valid = true);
+	bool instructionsAreValid() const;
 
-	/** Set color string for the glyph.
-	 * @param s new color string. It should be in format \#RRGGBB.
-	 * @sa colorString()
-	 */
-	void setColorString(const QString &s) {m_colorString = s;}
-	/** returns color string.
-	 * @sa setColorString()
-	 */
-	QString colorString() const {return m_colorString;}
+	void setColorString(const QString &s);
+	QString colorString() const;
 
-	/** Set comment string.
-	 * @sa comment()
-	 */
-	void setComment(const QString &s) {m_comment = s;}
-	/** returns comment string
-	 * @sa setComment()
-	 */
-	QString comment() const {return m_comment;}
+	void setComment(const QString &s);
+	QString comment() const;
 
-	void setUnicode(int u) {m_unicode = u;}
-	int unicode() const {return m_unicode;}
+	void setUnicode(int u);
+	int unicode() const;
 
 	bool computeMetrics(qreal &xMin, qreal &xMax, qreal &yMin, qreal &yMax) const;
 	void countParts(unsigned &nContours, unsigned &nRefs) const;

commit a7290bc650bc3c8420fe4b7563c1189901f6607e
Author: Eugeniy Meshcheryakov <eugen at debian.org>
Date:   Sat Nov 3 23:41:01 2007 +0100

    declare properties of FontDocument class

diff --git a/nongui/fontdocument.h b/nongui/fontdocument.h
index d64fe01..bf2212d 100644
--- a/nongui/fontdocument.h
+++ b/nongui/fontdocument.h
@@ -29,6 +29,24 @@ class Glyph;
  */
 class FontDocument : public QObject {
 	Q_OBJECT
+	Q_PROPERTY(QString copyright READ copyright WRITE setCopyright)
+	Q_PROPERTY(QString prep READ prep WRITE setPrep)
+	Q_PROPERTY(QString fpgm READ fpgm WRITE setFpgm)
+	Q_PROPERTY(QString fontName READ fontName WRITE setFontName)
+	Q_PROPERTY(QString fontFamily READ fontFamily WRITE setFontFamily)
+	Q_PROPERTY(QString fontWeight READ fontWeight WRITE setFontWeight)
+	Q_PROPERTY(qreal ascent READ ascent WRITE setAscent)
+	Q_PROPERTY(qreal descent READ descent WRITE setDescent)
+	Q_PROPERTY(qreal italicAngle READ italicAngle WRITE setItalicAngle)
+	Q_PROPERTY(qreal underlinePosition READ underlinePosition WRITE setUnderlinePosition)
+	Q_PROPERTY(qreal underlineThickness READ underlineThickness WRITE setUnderlineThickness)
+	Q_PROPERTY(bool changed READ changed WRITE setChanged)
+	Q_PROPERTY(unsigned zonesCount READ zonesCount WRITE setZonesCount)
+	Q_PROPERTY(unsigned maxTwilightPoints READ maxTwilightPoints WRITE setMaxTwilightPoints)
+	Q_PROPERTY(unsigned maxStorage READ maxStorage WRITE setMaxStorage)
+	Q_PROPERTY(unsigned maxFDEFs READ maxFDEFs WRITE setMaxFDEFs)
+	Q_PROPERTY(unsigned maxIDEFs READ maxIDEFs WRITE setMaxIDEFs)
+	Q_PROPERTY(unsigned maxStackDepth READ maxStackDepth WRITE setMaxStackDepth)
 public:
 	FontDocument(QObject *parent = 0);
 	

commit 86afb263dcb86cd1e57afa1a5cde3d5e1704a648
Author: Eugeniy Meshcheryakov <eugen at debian.org>
Date:   Sat Nov 3 23:28:06 2007 +0100

    move all inline functions for FontDocument class into cxx file

diff --git a/nongui/fontdocument.cxx b/nongui/fontdocument.cxx
index db0d6b9..284d7e0 100644
--- a/nongui/fontdocument.cxx
+++ b/nongui/fontdocument.cxx
@@ -16,6 +16,91 @@
  */
 #include "fontdocument.h"
 
+/** Construct empty font document.
+ */
+FontDocument::FontDocument(QObject *parent) : QObject(parent),
+	m_documentChanged(false)
+{
+}
+
+/** Set copyright string for the font document.
+ */
+void FontDocument::setCopyright(const QString &copyright)
+{
+	m_copyright = copyright;
+}
+
+/** returns copyright string for the document.
+ */
+QString FontDocument::copyright() const
+{
+	return m_copyright;
+}
+
+/** Set content of TryeType prep table.
+ * @sa prep()
+ */
+void FontDocument::setPrep(const QString &data)
+{
+	m_prep = data;
+}
+
+/** Set content of TrueType font program table.
+ * @sa fpgm()
+ */
+void FontDocument::setFpgm(const QString &data)
+{
+	m_fpgm = data;
+}
+
+/** returns content of TrueType prep table.
+ * @sa setPrep()
+ */
+QString FontDocument::prep() const
+{
+	return m_prep;
+}
+
+/** returns content of TrueType font program table.
+ * @sa setFpgm()
+ */
+QString FontDocument::fpgm() const
+{
+	return m_fpgm;
+}
+
+/** Add new control value table entry to the end of the list.
+ * @sa CVTEntry::CVTEntry() and cvt()
+ */
+void FontDocument::addCvtEntry(qint16 value, QString variableName, QString comment)
+{
+	m_cvt << CVTEntry(value, variableName, comment);
+}
+
+/** returns control value table.
+ * @sa addCvtEntry()
+ */
+const QVector<CVTEntry> &FontDocument::cvt() const
+{
+	return m_cvt;
+}
+
+/** returns list of glyphs in this document.
+ * @sa addGlyph()
+ */
+const QList<Glyph *> &FontDocument::glyphs() const
+{
+	return m_glyphs;
+}
+
+/** Add glyph to the font document.
+ * This function adds new glyph to the font document.
+ * If glyph with the same name is allready present in document function returns false and adds nothing.
+ * Iserted glyph reparented to this document.
+ * @param glyph a new glyph to add.
+ * @return true if glyph was added successfully, false otherwise.
+ * @see glyphs() and hasGlyph()
+ */
 bool FontDocument::addGlyph(Glyph *glyph)
 {
 	Q_ASSERT(glyph);
@@ -42,6 +127,18 @@ bool FontDocument::addGlyph(Glyph *glyph)
 	return true;
 }
 
+/** Check whether glyph with given name present in the document.
+ * @return true if document contains glyph with the given name, false otherwise.
+ */
+bool FontDocument::hasGlyph(const QString &name)
+{
+	return nameHash.contains(name);
+}
+
+/** Get named glyph.
+ * @return pointer to the named glyph or 0 if document contains no glyph with such name.
+ * @see hasGlyph()
+ */
 Glyph *FontDocument::getGlyph(const QString &name)
 {
 	// XXX is this hash needed?
@@ -50,6 +147,86 @@ Glyph *FontDocument::getGlyph(const QString &name)
 	return 0;
 }
 
+void FontDocument::setFontName(const QString &name)
+{
+	m_fontFace.fontName = name;
+}
+
+QString FontDocument::fontName() const
+{
+	return m_fontFace.fontName;
+}
+
+void FontDocument::setFontFamily(const QString &name)
+{
+	m_fontFace.fontFamily = name;
+}
+
+QString FontDocument::fontFamily() const
+{
+	return m_fontFace.fontFamily;
+}
+
+void FontDocument::setFontWeight(const QString &weight)
+{
+	m_fontFace.fontWeight = weight;
+}
+
+QString FontDocument::fontWeight() const
+{
+	return m_fontFace.fontWeight;
+}
+
+void FontDocument::setAscent(qreal ascent)
+{
+	m_fontFace.ascent = ascent;
+}
+
+qreal FontDocument::ascent() const
+{
+	return m_fontFace.ascent;
+}
+
+void FontDocument::setDescent(qreal descent)
+{
+	m_fontFace.descent = descent;
+}
+
+qreal FontDocument::descent() const
+{
+	return m_fontFace.descent;
+}
+
+void FontDocument::setItalicAngle(qreal italicAngle)
+{
+	m_fontFace.italicAngle = italicAngle;
+}
+
+qreal FontDocument::italicAngle() const
+{
+	return m_fontFace.italicAngle;
+}
+
+void FontDocument::setUnderlinePosition(qreal underlinePosition)
+{
+	m_fontFace.underlinePosition = underlinePosition;
+}
+
+qreal FontDocument::underlinePosition() const
+{
+	return m_fontFace.underlinePosition;
+}
+
+void FontDocument::setUnderlineThickness(qreal underlineThickness)
+{
+	m_fontFace.underlineThickness = underlineThickness;
+}
+
+qreal FontDocument::underlineThickness() const
+{
+	return m_fontFace.underlineThickness;
+}
+
 void FontDocument::setChanged(bool changed)
 {
 	if (changed != m_documentChanged) {
@@ -58,6 +235,11 @@ void FontDocument::setChanged(bool changed)
 	}
 }
 
+bool FontDocument::changed() const
+{
+	return m_documentChanged;
+}
+
 bool FontDocument::renameGlyph(Glyph *glyph, const QString &newName)
 {
 	Q_ASSERT(glyph);
@@ -75,6 +257,11 @@ bool FontDocument::renameGlyph(Glyph *glyph, const QString &newName)
 	return true;
 }
 
+bool FontDocument::hasUnicodeGlyph(int unicode) const
+{
+	return unicodeHash.contains(unicode);
+}
+
 bool FontDocument::changeUnicodeValue(Glyph *glyph, int unicode)
 {
 	Q_ASSERT(glyph);
@@ -148,6 +335,11 @@ void FontDocument::insertCvtEntries(int first, int count)
 	setChanged();
 }
 
+unsigned FontDocument::zonesCount() const
+{
+	return maxp.zonesCount;
+}
+
 bool FontDocument::setZonesCount(unsigned count)
 {
 	// font can only have one or two zones
@@ -160,6 +352,11 @@ bool FontDocument::setZonesCount(unsigned count)
 	return true;
 }
 
+unsigned FontDocument::maxTwilightPoints() const
+{
+	return maxp.maxTwilightPoints;
+}
+
 bool FontDocument::setMaxTwilightPoints(unsigned count)
 {
 	if (count > 0xFFFF)
@@ -171,6 +368,11 @@ bool FontDocument::setMaxTwilightPoints(unsigned count)
 	return true;
 }
 
+unsigned FontDocument::maxStorage() const
+{
+	return maxp.maxStorage;
+}
+
 bool FontDocument::setMaxStorage(unsigned size)
 {
 	if (size > 0xFFFF)
@@ -182,6 +384,11 @@ bool FontDocument::setMaxStorage(unsigned size)
 	return true;
 }
 
+unsigned FontDocument::maxFDEFs() const
+{
+	return maxp.maxFDEFs;
+}
+
 bool FontDocument::setMaxFDEFs(unsigned count)
 {
 	if (count > 0xFFFF)
@@ -193,6 +400,11 @@ bool FontDocument::setMaxFDEFs(unsigned count)
 	return true;
 }
 
+unsigned FontDocument::maxIDEFs() const
+{
+	return maxp.maxIDEFs;
+}
+
 bool FontDocument::setMaxIDEFs(unsigned count)
 {
 	if (count > 0xFFFF)
@@ -204,6 +416,11 @@ bool FontDocument::setMaxIDEFs(unsigned count)
 	return true;
 }
 
+unsigned FontDocument::maxStackDepth() const
+{
+	return maxp.maxStackDepth;
+}
+
 bool FontDocument::setMaxStackDepth(unsigned depth)
 {
 	if (depth > 0xFFFF)
diff --git a/nongui/fontdocument.h b/nongui/fontdocument.h
index 68e6ef1..d64fe01 100644
--- a/nongui/fontdocument.h
+++ b/nongui/fontdocument.h
@@ -30,93 +30,57 @@ class Glyph;
 class FontDocument : public QObject {
 	Q_OBJECT
 public:
-	/** Construct empty font document.
-	 */
-	FontDocument(QObject *parent = 0) : QObject(parent), m_documentChanged(false) {}
+	FontDocument(QObject *parent = 0);
 	
-	/** Set copyright string for the font document.
-	 */
-	void setCopyright(const QString &copyright) {m_copyright = copyright;}
-	/** returns copyright string for the document.
-	 */
-	QString copyright() const {return m_copyright;}
-
-	/** Set content of TryeType prep table.
-	 * @sa prep()
-	 */
-	void setPrep(const QString &data) {m_prep = data;}
-	/** Set content of TrueType font program table.
-	 * @sa fpgm()
-	 */
-	void setFpgm(const QString &data) {m_fpgm = data;}
-
-	/** returns content of TrueType prep table.
-	 * @sa setPrep()
-	 */
-	QString prep() const {return m_prep;}
-	/** returns content of TrueType font program table.
-	 * @sa setFpgm()
-	 */
-	QString fpgm() const {return m_fpgm;}
-
-	/** Add new control value table entry to the end of the list.
-	 * @sa CVTEntry::CVTEntry() and cvt()
-	 */
-	void addCvtEntry(qint16 value, QString variableName = QString(), QString comment = QString()) {m_cvt << CVTEntry(value, variableName, comment);}
-	/** returns control value table.
-	 * @sa addCvtEntry()
-	 */
-	const QVector<CVTEntry> &cvt() const {return m_cvt;}
-
-	/** returns list of glyphs in this document.
-	 * @sa addGlyph()
-	 */
-	const QList<Glyph *> &glyphs() const {return m_glyphs;}
-	/** Add glyph to the font document.
-	 * This function adds new glyph to the font document.
-	 * If glyph with the same name is allready present in document function returns false and adds nothing.
-	 * Iserted glyph reparented to this document.
-	 * @param glyph a new glyph to add.
-	 * @return true if glyph was added successfully, false otherwise.
-	 * @see glyphs() and hasGlyph()
-	 */
+	void setCopyright(const QString &copyright);
+	QString copyright() const;
+
+	void setPrep(const QString &data);
+	void setFpgm(const QString &data);
+	QString prep() const;
+	QString fpgm() const;
+
+	void addCvtEntry(qint16 value, QString variableName = QString(), QString comment = QString());
+	const QVector<CVTEntry> &cvt() const;
+
+	const QList<Glyph *> &glyphs() const;
+
 	bool addGlyph(Glyph *glyph);
-	/** Check whether glyph with given name present in the document.
-	 * @return true if document contains glyph with the given name, false otherwise.
-	 */
-	bool hasGlyph(const QString &name) {return nameHash.contains(name);}
-	/** Get named glyph.
-	 * @return pointer to the named glyph or 0 if document contains no glyph with such name.
-	 * @see hasGlyph()
-	 */
+	bool hasGlyph(const QString &name);
 	Glyph *getGlyph(const QString &name);
 
-	void setFontName(const QString &name) {m_fontFace.fontName = name;}
-	QString fontName() const {return m_fontFace.fontName;}
-	void setFontFamily(const QString &name) {m_fontFace.fontFamily = name;}
-	QString fontFamily() const {return m_fontFace.fontFamily;}
-	void setFontWeight(const QString &weight) {m_fontFace.fontWeight = weight;}
-	QString fontWeight() const {return m_fontFace.fontWeight;}
-	void setAscent(qreal ascent) {m_fontFace.ascent = ascent;}
-	qreal ascent() const {return m_fontFace.ascent;}
-	void setDescent(qreal descent) {m_fontFace.descent = descent;}
-	qreal descent() const {return m_fontFace.descent;}
-	void setItalicAngle(qreal italicAngle) {m_fontFace.italicAngle = italicAngle;}
-	qreal italicAngle() const {return m_fontFace.italicAngle;}
-	void setUnderlinePosition(qreal underlinePosition) {m_fontFace.underlinePosition = underlinePosition;}
-	qreal underlinePosition() const {return m_fontFace.underlinePosition;}
-	void setUnderlineThickness(qreal underlineThickness) {m_fontFace.underlineThickness = underlineThickness;}
-	qreal underlineThickness() const {return m_fontFace.underlineThickness;}
+	void setFontName(const QString &name);
+	QString fontName() const;
+
+	void setFontFamily(const QString &name);
+	QString fontFamily() const;
+
+	void setFontWeight(const QString &weight);
+	QString fontWeight() const;
+
+	void setAscent(qreal ascent);
+	qreal ascent() const;
+
+	void setDescent(qreal descent);
+	qreal descent() const;
+
+	void setItalicAngle(qreal italicAngle);
+	qreal italicAngle() const;
+
+	void setUnderlinePosition(qreal underlinePosition);
+	qreal underlinePosition() const;
+	
+	void setUnderlineThickness(qreal underlineThickness);
+	qreal underlineThickness() const;
 
 	void setChanged(bool changed = true);
-	bool changed() const {return m_documentChanged;}
+	bool changed() const;
 
 	QList<Lookup> lookups;
 
 	bool renameGlyph(Glyph *glyph, const QString &newName);
 
-	bool hasUnicodeGlyph(int unicode) const {return unicodeHash.contains(unicode);}
-
+	bool hasUnicodeGlyph(int unicode) const;
 	bool changeUnicodeValue(Glyph *glyph, int unicode);
 
 	void removeGlyphs(int first, int count);
@@ -127,17 +91,22 @@ public:
 	void insertCvtEntries(int first, int count);
 
 	// maxp table related functions
-	unsigned zonesCount() const {return maxp.zonesCount;}
+	unsigned zonesCount() const;
 	bool setZonesCount(unsigned count);
-	unsigned maxTwilightPoints() const {return maxp.maxTwilightPoints;}
+
+	unsigned maxTwilightPoints() const;
 	bool setMaxTwilightPoints(unsigned count);
-	unsigned maxStorage() const {return maxp.maxStorage;}
+
+	unsigned maxStorage() const;
 	bool setMaxStorage(unsigned size);
-	unsigned maxFDEFs() const {return maxp.maxFDEFs;}
+
+	unsigned maxFDEFs() const;
 	bool setMaxFDEFs(unsigned count);
-	unsigned maxIDEFs() const {return maxp.maxIDEFs;}
+
+	unsigned maxIDEFs() const;
 	bool setMaxIDEFs(unsigned count);
-	unsigned maxStackDepth() const {return maxp.maxStackDepth;}
+
+	unsigned maxStackDepth() const;
 	bool setMaxStackDepth(unsigned depth);
 protected slots:
 	void glyphOutlineChanged(Glyph *g);

commit 2b13b88f0b0ad5e5cfb31fdfb1a41fb93c495c5d
Author: Eugeniy Meshcheryakov <eugen at debian.org>
Date:   Thu Oct 25 16:31:29 2007 +0200

    remove unused signal GlyphsModel::glyphOutlineChanged()

diff --git a/gui/glyphsmodel.h b/gui/glyphsmodel.h
index dc52ba6..9f77c62 100644
--- a/gui/glyphsmodel.h
+++ b/gui/glyphsmodel.h
@@ -49,8 +49,6 @@ public:
 	bool removeRows(int row, int count, const QModelIndex &index);
 public slots:
 	void glyphChanged(int glyphNo);
-signals:
-	void glyphOutlineChanged(const QModelIndex &index);
 private:
 	static void drawGlyph(PathList *paths, const Glyph *glyph);
 	static void drawContours(PathList *paths, const Glyph *glyph, int order, QPoint off);

commit 111183234dac72970476f21387a3c35ca342abd8
Author: Eugeniy Meshcheryakov <eugen at debian.org>
Date:   Thu Oct 25 16:28:49 2007 +0200

    remove unused signal GlyphsModel::glyphPointMoved()

diff --git a/gui/glyphsmodel.h b/gui/glyphsmodel.h
index 146be4f..dc52ba6 100644
--- a/gui/glyphsmodel.h
+++ b/gui/glyphsmodel.h
@@ -50,7 +50,6 @@ public:
 public slots:
 	void glyphChanged(int glyphNo);
 signals:
-	void glyphPointMoved(const QModelIndex &index, int component, int pointNo, const QPointF &newPos);
 	void glyphOutlineChanged(const QModelIndex &index);
 private:
 	static void drawGlyph(PathList *paths, const Glyph *glyph);

-- 
Fondue Font Editor



More information about the fondue-commits mailing list