diff options
Diffstat (limited to 'experimental/tqtinterface/qt4/plugins/src/codecs')
9 files changed, 287 insertions, 0 deletions
diff --git a/experimental/tqtinterface/qt4/plugins/src/codecs/cn/cn.pro b/experimental/tqtinterface/qt4/plugins/src/codecs/cn/cn.pro new file mode 100644 index 000000000..340df17c4 --- /dev/null +++ b/experimental/tqtinterface/qt4/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/tqgb18030codec.h \ + ../../../../include/private/tqfontcodecs_p.h + +SOURCES = ../../../../src/codecs/tqgb18030codec.cpp \ + ../../../../src/codecs/tqfontcncodec.cpp \ + main.cpp + + +target.path += $$plugins.path/codecs +INSTALLS += target diff --git a/experimental/tqtinterface/qt4/plugins/src/codecs/cn/main.cpp b/experimental/tqtinterface/qt4/plugins/src/codecs/cn/main.cpp new file mode 100644 index 000000000..3c9064c6a --- /dev/null +++ b/experimental/tqtinterface/qt4/plugins/src/codecs/cn/main.cpp @@ -0,0 +1,52 @@ +#include <tqtextcodecplugin.h> +#include <tqtextcodec.h> +#include <tqptrlist.h> +#include <tqapplication.h> + +#include <tqgb18030codec.h> +#include <private/tqfontcodecs_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; +} + + +TQ_EXPORT_PLUGIN( CNTextCodecs ); diff --git a/experimental/tqtinterface/qt4/plugins/src/codecs/codecs.pro b/experimental/tqtinterface/qt4/plugins/src/codecs/codecs.pro new file mode 100644 index 000000000..41775f777 --- /dev/null +++ b/experimental/tqtinterface/qt4/plugins/src/codecs/codecs.pro @@ -0,0 +1,5 @@ +TEMPLATE = subdirs + +!bigcodecs { + SUBDIRS += cn jp kr tw +} diff --git a/experimental/tqtinterface/qt4/plugins/src/codecs/jp/jp.pro b/experimental/tqtinterface/qt4/plugins/src/codecs/jp/jp.pro new file mode 100644 index 000000000..98ddbaa72 --- /dev/null +++ b/experimental/tqtinterface/qt4/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/tqeucjpcodec.h \ + ../../../../include/tqjiscodec.h \ + ../../../../include/tqsjiscodec.h \ + ../../../../include/tqjpunicode.h \ + ../../../../include/private/tqfontcodecs_p.h + +SOURCES = ../../../../src/codecs/tqeucjpcodec.cpp \ + ../../../../src/codecs/tqjiscodec.cpp \ + ../../../../src/codecs/tqsjiscodec.cpp \ + ../../../../src/codecs/tqjpunicode.cpp \ + ../../../../src/codecs/tqfontjpcodec.cpp \ + main.cpp + + +target.path += $$plugins.path/codecs +INSTALLS += target + diff --git a/experimental/tqtinterface/qt4/plugins/src/codecs/jp/main.cpp b/experimental/tqtinterface/qt4/plugins/src/codecs/jp/main.cpp new file mode 100644 index 000000000..8b0f8f941 --- /dev/null +++ b/experimental/tqtinterface/qt4/plugins/src/codecs/jp/main.cpp @@ -0,0 +1,56 @@ +#include <tqtextcodecplugin.h> +#include <tqtextcodec.h> +#include <tqptrlist.h> + +#include <tqeucjpcodec.h> +#include <tqjiscodec.h> +#include <tqsjiscodec.h> +#include <private/tqfontcodecs_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; +} + + +TQ_EXPORT_PLUGIN( JPTextCodecs ); diff --git a/experimental/tqtinterface/qt4/plugins/src/codecs/kr/kr.pro b/experimental/tqtinterface/qt4/plugins/src/codecs/kr/kr.pro new file mode 100644 index 000000000..44c91097a --- /dev/null +++ b/experimental/tqtinterface/qt4/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/tqeuckrcodec.h \ + ../../../../include/private/tqfontcodecs_p.h + +SOURCES = ../../../../src/codecs/tqeuckrcodec.cpp \ + ../../../../src/codecs/tqfontkrcodec.cpp \ + main.cpp + + +target.path += $$plugins.path/codecs +INSTALLS += target + diff --git a/experimental/tqtinterface/qt4/plugins/src/codecs/kr/main.cpp b/experimental/tqtinterface/qt4/plugins/src/codecs/kr/main.cpp new file mode 100644 index 000000000..fa76ad551 --- /dev/null +++ b/experimental/tqtinterface/qt4/plugins/src/codecs/kr/main.cpp @@ -0,0 +1,47 @@ +#include <tqtextcodecplugin.h> +#include <tqtextcodec.h> +#include <tqptrlist.h> + +#include <tqeuckrcodec.h> +#include <private/tqfontcodecs_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; +} + + +TQ_EXPORT_PLUGIN( KRTextCodecs ); diff --git a/experimental/tqtinterface/qt4/plugins/src/codecs/tw/main.cpp b/experimental/tqtinterface/qt4/plugins/src/codecs/tw/main.cpp new file mode 100644 index 000000000..6991b33f1 --- /dev/null +++ b/experimental/tqtinterface/qt4/plugins/src/codecs/tw/main.cpp @@ -0,0 +1,47 @@ +#include <tqtextcodecplugin.h> +#include <tqtextcodec.h> +#include <tqptrlist.h> + +#include <tqbig5codec.h> +#include <private/tqfontcodecs_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; +} + + +TQ_EXPORT_PLUGIN( TWTextCodecs ); + diff --git a/experimental/tqtinterface/qt4/plugins/src/codecs/tw/tw.pro b/experimental/tqtinterface/qt4/plugins/src/codecs/tw/tw.pro new file mode 100644 index 000000000..da264b70e --- /dev/null +++ b/experimental/tqtinterface/qt4/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/tqbig5codec.h \ + ../../../../include/private/tqfontcodecs_p.h +SOURCES = ../../../../src/codecs/tqbig5codec.cpp \ + ../../../../src/codecs/tqfonttwcodec.cpp \ + main.cpp + + +target.path += $$plugins.path/codecs +INSTALLS += target + |