diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-07-10 15:24:15 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-07-10 15:24:15 -0500 |
commit | bd0f3345a938b35ce6a12f6150373b0955b8dd12 (patch) | |
tree | 7a520322212d48ebcb9fbe1087e7fca28b76185c /plugins/src/codecs | |
download | qt3-bd0f3345a938b35ce6a12f6150373b0955b8dd12.tar.gz qt3-bd0f3345a938b35ce6a12f6150373b0955b8dd12.zip |
Add Qt3 development HEAD version
Diffstat (limited to 'plugins/src/codecs')
-rw-r--r-- | plugins/src/codecs/cn/cn.pro | 18 | ||||
-rw-r--r-- | plugins/src/codecs/cn/main.cpp | 52 | ||||
-rw-r--r-- | plugins/src/codecs/codecs.pro | 5 | ||||
-rw-r--r-- | plugins/src/codecs/jp/jp.pro | 25 | ||||
-rw-r--r-- | plugins/src/codecs/jp/main.cpp | 56 | ||||
-rw-r--r-- | plugins/src/codecs/kr/kr.pro | 19 | ||||
-rw-r--r-- | plugins/src/codecs/kr/main.cpp | 47 | ||||
-rw-r--r-- | plugins/src/codecs/tw/main.cpp | 47 | ||||
-rw-r--r-- | plugins/src/codecs/tw/tw.pro | 18 |
9 files changed, 287 insertions, 0 deletions
diff --git a/plugins/src/codecs/cn/cn.pro b/plugins/src/codecs/cn/cn.pro new file mode 100644 index 0000000..4969129 --- /dev/null +++ b/plugins/src/codecs/cn/cn.pro @@ -0,0 +1,18 @@ +TEMPLATE = lib +TARGET = qcncodecs + +CONFIG += qt warn_on plugin +DESTDIR = ../../../codecs + +REQUIRES = !bigcodecs + +HEADERS = ../../../../include/qgb18030codec.h \ + ../../../../include/private/qfontcodecs_p.h + +SOURCES = ../../../../src/codecs/qgb18030codec.cpp \ + ../../../../src/codecs/qfontcncodec.cpp \ + main.cpp + + +target.path += $$plugins.path/codecs +INSTALLS += target diff --git a/plugins/src/codecs/cn/main.cpp b/plugins/src/codecs/cn/main.cpp new file mode 100644 index 0000000..a6f1173 --- /dev/null +++ b/plugins/src/codecs/cn/main.cpp @@ -0,0 +1,52 @@ +#include <qtextcodecplugin.h> +#include <qtextcodec.h> +#include <qptrlist.h> +#include <qapplication.h> + +#include <qgb18030codec.h> +#include <private/qfontcodecs_p.h> + + +class CNTextCodecs : public QTextCodecPlugin +{ +public: + CNTextCodecs() {} + + QStringList names() const { return QStringList() << "GB18030" << "GBK" << "gb2312.1980-0" << "gbk-0"; } + QValueList<int> mibEnums() const { return QValueList<int>() << -2025 << 57 << 2025; } + + QTextCodec *createForMib( int ); + QTextCodec *createForName( const QString & ); +}; + +QTextCodec *CNTextCodecs::createForMib( int mib ) +{ + switch (mib) { + case 57: + return new QGb2312Codec; + case 2025: + return new QGbkCodec; + case -2025: + return new QGb18030Codec; + default: + ; + } + + return 0; +} + + +QTextCodec *CNTextCodecs::createForName( const QString &name ) +{ + if (name == "GB18030") + return new QGb18030Codec; + if (name == "GBK" || name == "gbk-0") + return new QGbkCodec; + if (name == "gb2312.1980-0") + return new QGb2312Codec; + + return 0; +} + + +Q_EXPORT_PLUGIN( CNTextCodecs ); diff --git a/plugins/src/codecs/codecs.pro b/plugins/src/codecs/codecs.pro new file mode 100644 index 0000000..41775f7 --- /dev/null +++ b/plugins/src/codecs/codecs.pro @@ -0,0 +1,5 @@ +TEMPLATE = subdirs + +!bigcodecs { + SUBDIRS += cn jp kr tw +} diff --git a/plugins/src/codecs/jp/jp.pro b/plugins/src/codecs/jp/jp.pro new file mode 100644 index 0000000..5968754 --- /dev/null +++ b/plugins/src/codecs/jp/jp.pro @@ -0,0 +1,25 @@ +TEMPLATE = lib +TARGET = qjpcodecs + +CONFIG += qt warn_on plugin +DESTDIR = ../../../codecs + +REQUIRES = !bigcodecs + +HEADERS = ../../../../include/qeucjpcodec.h \ + ../../../../include/qjiscodec.h \ + ../../../../include/qsjiscodec.h \ + ../../../../include/qjpunicode.h \ + ../../../../include/private/qfontcodecs_p.h + +SOURCES = ../../../../src/codecs/qeucjpcodec.cpp \ + ../../../../src/codecs/qjiscodec.cpp \ + ../../../../src/codecs/qsjiscodec.cpp \ + ../../../../src/codecs/qjpunicode.cpp \ + ../../../../src/codecs/qfontjpcodec.cpp \ + main.cpp + + +target.path += $$plugins.path/codecs +INSTALLS += target + diff --git a/plugins/src/codecs/jp/main.cpp b/plugins/src/codecs/jp/main.cpp new file mode 100644 index 0000000..c7ed27c --- /dev/null +++ b/plugins/src/codecs/jp/main.cpp @@ -0,0 +1,56 @@ +#include <qtextcodecplugin.h> +#include <qtextcodec.h> +#include <qptrlist.h> + +#include <qeucjpcodec.h> +#include <qjiscodec.h> +#include <qsjiscodec.h> +#include <private/qfontcodecs_p.h> + + +class JPTextCodecs : public QTextCodecPlugin +{ +public: + JPTextCodecs() {} + + QStringList names() const { return QStringList() << "eucJP" << "JIS7" << "SJIS" << "jisx0208.1983-0"; } + QValueList<int> mibEnums() const { return QValueList<int>() << 16 << 17 << 18 << 63; } + QTextCodec *createForMib( int ); + QTextCodec *createForName( const QString & ); +}; + +QTextCodec *JPTextCodecs::createForMib( int mib ) +{ + switch (mib) { + case 16: + return new QJisCodec; + case 17: + return new QSjisCodec; + case 18: + return new QEucJpCodec; + case 63: + return new QFontJis0208Codec; + default: + ; + } + + return 0; +} + + +QTextCodec *JPTextCodecs::createForName( const QString &name ) +{ + if (name == "JIS7") + return new QJisCodec; + if (name == "SJIS") + return new QSjisCodec; + if (name == "eucJP") + return new QEucJpCodec; + if (name == "jisx0208.1983-0") + return new QFontJis0208Codec; + + return 0; +} + + +Q_EXPORT_PLUGIN( JPTextCodecs ); diff --git a/plugins/src/codecs/kr/kr.pro b/plugins/src/codecs/kr/kr.pro new file mode 100644 index 0000000..472373f --- /dev/null +++ b/plugins/src/codecs/kr/kr.pro @@ -0,0 +1,19 @@ +TEMPLATE = lib +TARGET = qkrcodecs + +CONFIG += qt warn_on plugin +DESTDIR = ../../../codecs + +REQUIRES = !bigcodecs + +HEADERS = ../../../../include/qeuckrcodec.h \ + ../../../../include/private/qfontcodecs_p.h + +SOURCES = ../../../../src/codecs/qeuckrcodec.cpp \ + ../../../../src/codecs/qfontkrcodec.cpp \ + main.cpp + + +target.path += $$plugins.path/codecs +INSTALLS += target + diff --git a/plugins/src/codecs/kr/main.cpp b/plugins/src/codecs/kr/main.cpp new file mode 100644 index 0000000..2b80442 --- /dev/null +++ b/plugins/src/codecs/kr/main.cpp @@ -0,0 +1,47 @@ +#include <qtextcodecplugin.h> +#include <qtextcodec.h> +#include <qptrlist.h> + +#include <qeuckrcodec.h> +#include <private/qfontcodecs_p.h> + + +class KRTextCodecs : public QTextCodecPlugin +{ +public: + KRTextCodecs() {} + + QStringList names() const { return QStringList() << "eucKR" << "ksc5601.1987-0"; } + QValueList<int> mibEnums() const { return QValueList<int>() << 38 << 36; } + QTextCodec *createForMib( int ); + QTextCodec *createForName( const QString & ); +}; + + +QTextCodec *KRTextCodecs::createForMib( int mib ) +{ + switch (mib) { + case 36: + return new QFontKsc5601Codec; + case 38: + return new QEucKrCodec; + default: + ; + } + + return 0; +} + + +QTextCodec *KRTextCodecs::createForName( const QString &name ) +{ + if (name == "eucKR") + return new QEucKrCodec; + if (name == "ksc5601.1987-0") + return new QFontKsc5601Codec; + + return 0; +} + + +Q_EXPORT_PLUGIN( KRTextCodecs ); diff --git a/plugins/src/codecs/tw/main.cpp b/plugins/src/codecs/tw/main.cpp new file mode 100644 index 0000000..662ef30 --- /dev/null +++ b/plugins/src/codecs/tw/main.cpp @@ -0,0 +1,47 @@ +#include <qtextcodecplugin.h> +#include <qtextcodec.h> +#include <qptrlist.h> + +#include <qbig5codec.h> +#include <private/qfontcodecs_p.h> + + +class TWTextCodecs : public QTextCodecPlugin +{ +public: + TWTextCodecs() {} + + QStringList names() const { return QStringList() << "Big5" << "big5*-0"; } + QValueList<int> mibEnums() const { return QValueList<int>() << 2026 << -2026; } + QTextCodec *createForMib( int ); + QTextCodec *createForName( const QString & ); +}; + +QTextCodec *TWTextCodecs::createForMib( int mib ) +{ + switch (mib) { + case -2026: + return new QFontBig5Codec; + case 2026: + return new QBig5Codec; + default: + ; + } + + return 0; +} + + +QTextCodec *TWTextCodecs::createForName( const QString &name ) +{ + if (name == "Big5") + return new QBig5Codec; + if (name == "big5*-0") + return new QFontBig5Codec; + + return 0; +} + + +Q_EXPORT_PLUGIN( TWTextCodecs ); + diff --git a/plugins/src/codecs/tw/tw.pro b/plugins/src/codecs/tw/tw.pro new file mode 100644 index 0000000..6c705c8 --- /dev/null +++ b/plugins/src/codecs/tw/tw.pro @@ -0,0 +1,18 @@ +TEMPLATE = lib +TARGET = qtwcodecs + +CONFIG += qt warn_on plugin +DESTDIR = ../../../codecs + +REQUIRES = !bigcodecs + +HEADERS = ../../../../include/qbig5codec.h \ + ../../../../include/private/qfontcodecs_p.h +SOURCES = ../../../../src/codecs/qbig5codec.cpp \ + ../../../../src/codecs/qfonttwcodec.cpp \ + main.cpp + + +target.path += $$plugins.path/codecs +INSTALLS += target + |