[fondue-commits] [SCM] Fondue Font Editor branch, master, updated. 1b8055ebf3f12c2c8411badf252986e1cd807bf0
Eugeniy Meshcheryakov
eugen at debian.org
Fri Aug 8 20:46:15 UTC 2008
The following commit has been merged in the master branch:
commit 9fffa6915e6a1fef250a73a960c2d19ba4912df6
Author: Eugeniy Meshcheryakov <eugen at debian.org>
Date: Fri Aug 8 17:27:35 2008 +0200
add documentation for filters classes
diff --git a/filters/exportfilterbase.h b/filters/exportfilterbase.h
index 25dc607..7bd60e5 100644
--- a/filters/exportfilterbase.h
+++ b/filters/exportfilterbase.h
@@ -22,12 +22,24 @@
class QFile;
class FontDocument;
+/**
+ * \defgroup export_filters Font Export Filters
+ */
+
+/**
+ * Base class for font export filters.
+ * \ingroup export_filters
+ */
class ExportFilterBase {
public:
- virtual QString menuName() const = 0;
- virtual QString fileMask() const = 0;
+ virtual QString menuName() const = 0; /**< Returns string that should appear in the Export menu. */
+ virtual QString fileMask() const = 0; /**< Returns file mask for save dialog. */
+ /**
+ * Exports \a doc to a \a file.
+ * Returns true on success.
+ */
virtual bool exportFile(FontDocument *doc, QFile *file) = 0;
- virtual QStringList errors() const {return QStringList();}
+ virtual QStringList errors() const {return QStringList();} /**< Returns list of error strings, if any. */
};
Q_DECLARE_METATYPE(ExportFilterBase*)
diff --git a/filters/importfilterbase.h b/filters/importfilterbase.h
index 21fcddd..a29713f 100644
--- a/filters/importfilterbase.h
+++ b/filters/importfilterbase.h
@@ -22,12 +22,24 @@
class QFile;
class FontDocument;
+/**
+ * \defgroup import_filters Font Import Filters
+ */
+
+/**
+ * Base class for font import filters.
+ * \ingroup import_filters
+ */
class ImportFilterBase {
public:
- virtual QString menuName() const = 0;
- virtual QString fileMask() const = 0;
+ virtual QString menuName() const = 0; /**< Returns string that should appear in the Import menu. */
+ virtual QString fileMask() const = 0; /**< Returns file mask for file open dialog. */
+ /**
+ * Reads \a file and returns a font document.
+ * Returns 0 if import was not successful.
+ */
virtual FontDocument *importFile(QFile *file) = 0;
- virtual QStringList errors() const {return QStringList();}
+ virtual QStringList errors() const {return QStringList();} /**< Returns list of error strings, if any. */
};
Q_DECLARE_METATYPE(ImportFilterBase*)
diff --git a/filters/sfdimportfilter.cxx b/filters/sfdimportfilter.cxx
index 909cde3..07c7692 100644
--- a/filters/sfdimportfilter.cxx
+++ b/filters/sfdimportfilter.cxx
@@ -42,16 +42,28 @@ private:
QHash<QString, QStringList> references;
};
+/**
+ * \class SFDImportFilter sfdimportfilter.h
+ * FontForge SFD import filter.
+ * \ingroup import_filters
+ */
+
+/** \copydoc ImportFilterBase::menuName() const
+ */
QString SFDImportFilter::menuName() const
{
return "FontForge SFD File...";
}
+/** \copydoc ImportFilterBase::fileMask() const
+ */
QString SFDImportFilter::fileMask() const
{
return "FontForge SFD files (*.sfd)";
}
+/** \copydoc ImportFilterBase::importFile(QFile*)
+ */
FontDocument *SFDImportFilter::importFile(QFile *file)
{
Q_ASSERT(file);
@@ -61,6 +73,8 @@ FontDocument *SFDImportFilter::importFile(QFile *file)
return priv.importFile(file);
}
+/** \copydoc ImportFilterBase::errors() const
+ */
QStringList SFDImportFilter::errors() const
{
return m_errors;
diff --git a/filters/ttfexportfilter.cxx b/filters/ttfexportfilter.cxx
index ebd7cfc..28fff18 100644
--- a/filters/ttfexportfilter.cxx
+++ b/filters/ttfexportfilter.cxx
@@ -25,6 +25,9 @@
#include <QStringList>
#include <QFile>
+/**
+ * Internal class for exporting font documents into a TrueType file.
+ */
class TTFWriter {
public:
TTFWriter(const FontDocument *doc);
@@ -66,16 +69,28 @@ private:
qint16 maxExtent;
};
+/**
+ * \class TTFExportFilter ttfexportfilter.h
+ * TrueType export filter.
+ * \ingroup export_filters
+ */
+
+/** \copydoc ExportFilterBase::menuName() const
+ */
QString TTFExportFilter::menuName() const
{
return "TrueType File...";
}
+/** \copydoc ExportFilterBase::fileMask() const
+ */
QString TTFExportFilter::fileMask() const
{
return "TrueType files (*.ttf)";
}
+/** \copydoc ExportFilterBase::exportFile(FontDocument*, QFile*)
+ */
bool TTFExportFilter::exportFile(FontDocument *doc, QFile *file)
{
Q_ASSERT(doc);
@@ -91,6 +106,10 @@ static inline quint32 makeTag(unsigned char a, unsigned char b,
return (a << 24) + (b << 16) + (c << 8) + d;
}
+/**
+ * Returns integer part of binary logarithm of \a v.
+ * \a T should be an integer type.
+ */
// TODO it should be possible to optimize it with GCC extensions
template <typename T>
static inline T integerLog2(T v)
@@ -102,6 +121,10 @@ static inline T integerLog2(T v)
return ret;
}
+/**
+ * Returns maximum power of 2 smaller than \a v.
+ * \a T should be an integer type.
+ */
template <typename T>
static inline T maxPowerOfTwo(T v)
{
--
Fondue Font Editor
More information about the fondue-commits
mailing list