From d796c9dd933ab96ec83b9a634feedd5d32e1ba3f Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Tue, 8 Nov 2011 12:31:36 -0600 Subject: Test conversion to TQt3 from Qt3 8c6fc1f8e35fd264dd01c582ca5e7549b32ab731 --- plugins/src/codecs/jp/jp.pro | 25 +++++++++++++++++++ plugins/src/codecs/jp/main.cpp | 56 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+) create mode 100644 plugins/src/codecs/jp/jp.pro create mode 100644 plugins/src/codecs/jp/main.cpp (limited to 'plugins/src/codecs/jp') 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 +#include +#include + +#include +#include +#include +#include + + +class JPTextCodecs : public TQTextCodecPlugin +{ +public: + JPTextCodecs() {} + + TQStringList names() const { return TQStringList() << "eucJP" << "JIS7" << "SJIS" << "jisx0208.1983-0"; } + TQValueList mibEnums() const { return TQValueList() << 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 ); -- cgit v1.2.1