diff options
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 000000000..496912905 --- /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 000000000..23cec30c8 --- /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 TQTextCodecPlugin +{ +public: + CNTextCodecs() {} + + TQStringList names() const { return TQStringList() << "GB18030" << "GBK" << "gb2312.1980-0" << "gbk-0"; } + TQValueList<int> mibEnums() const { return TQValueList<int>() << -2025 << 57 << 2025; } + + TQTextCodec *createForMib( int ); + TQTextCodec *createForName( const TQString & ); +}; + +TQTextCodec *CNTextCodecs::createForMib( int mib ) +{ + switch (mib) { + case 57: + return new TQGb2312Codec; + case 2025: + return new TQGbkCodec; + case -2025: + return new TQGb18030Codec; + default: + ; + } + + return 0; +} + + +TQTextCodec *CNTextCodecs::createForName( const TQString &name ) +{ + if (name == "GB18030") + return new TQGb18030Codec; + if (name == "GBK" || name == "gbk-0") + return new TQGbkCodec; + if (name == "gb2312.1980-0") + return new TQGb2312Codec; + + 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 000000000..41775f777 --- /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 000000000..59687543c --- /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 000000000..1c7b4b0df --- /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 TQTextCodecPlugin +{ +public: + JPTextCodecs() {} + + TQStringList names() const { return TQStringList() << "eucJP" << "JIS7" << "SJIS" << "jisx0208.1983-0"; } + TQValueList<int> mibEnums() const { return TQValueList<int>() << 16 << 17 << 18 << 63; } + TQTextCodec *createForMib( int ); + TQTextCodec *createForName( const TQString & ); +}; + +TQTextCodec *JPTextCodecs::createForMib( int mib ) +{ + switch (mib) { + case 16: + return new TQJisCodec; + case 17: + return new TQSjisCodec; + case 18: + return new TQEucJpCodec; + case 63: + return new TQFontJis0208Codec; + default: + ; + } + + return 0; +} + + +TQTextCodec *JPTextCodecs::createForName( const TQString &name ) +{ + if (name == "JIS7") + return new TQJisCodec; + if (name == "SJIS") + return new TQSjisCodec; + if (name == "eucJP") + return new TQEucJpCodec; + if (name == "jisx0208.1983-0") + return new TQFontJis0208Codec; + + 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 000000000..472373f41 --- /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 000000000..2515d594c --- /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 TQTextCodecPlugin +{ +public: + KRTextCodecs() {} + + TQStringList names() const { return TQStringList() << "eucKR" << "ksc5601.1987-0"; } + TQValueList<int> mibEnums() const { return TQValueList<int>() << 38 << 36; } + TQTextCodec *createForMib( int ); + TQTextCodec *createForName( const TQString & ); +}; + + +TQTextCodec *KRTextCodecs::createForMib( int mib ) +{ + switch (mib) { + case 36: + return new TQFontKsc5601Codec; + case 38: + return new TQEucKrCodec; + default: + ; + } + + return 0; +} + + +TQTextCodec *KRTextCodecs::createForName( const TQString &name ) +{ + if (name == "eucKR") + return new TQEucKrCodec; + if (name == "ksc5601.1987-0") + return new TQFontKsc5601Codec; + + 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 000000000..5b4134040 --- /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 TQTextCodecPlugin +{ +public: + TWTextCodecs() {} + + TQStringList names() const { return TQStringList() << "Big5" << "big5*-0"; } + TQValueList<int> mibEnums() const { return TQValueList<int>() << 2026 << -2026; } + TQTextCodec *createForMib( int ); + TQTextCodec *createForName( const TQString & ); +}; + +TQTextCodec *TWTextCodecs::createForMib( int mib ) +{ + switch (mib) { + case -2026: + return new TQFontBig5Codec; + case 2026: + return new TQBig5Codec; + default: + ; + } + + return 0; +} + + +TQTextCodec *TWTextCodecs::createForName( const TQString &name ) +{ + if (name == "Big5") + return new TQBig5Codec; + if (name == "big5*-0") + return new TQFontBig5Codec; + + 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 000000000..6c705c8e1 --- /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 + |