From dda8474928bd7276e1fad8fb7a601e7c83ff2bc2 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sun, 10 Jul 2011 15:17:53 -0500 Subject: Added TQt4 HEAD --- tqtinterface/qt4/plugins/src/codecs/jp/jp.pro | 25 +++++++++++ tqtinterface/qt4/plugins/src/codecs/jp/main.cpp | 56 +++++++++++++++++++++++++ 2 files changed, 81 insertions(+) create mode 100644 tqtinterface/qt4/plugins/src/codecs/jp/jp.pro create mode 100644 tqtinterface/qt4/plugins/src/codecs/jp/main.cpp (limited to 'tqtinterface/qt4/plugins/src/codecs/jp') diff --git a/tqtinterface/qt4/plugins/src/codecs/jp/jp.pro b/tqtinterface/qt4/plugins/src/codecs/jp/jp.pro new file mode 100644 index 0000000..98ddbaa --- /dev/null +++ b/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/tqtinterface/qt4/plugins/src/codecs/jp/main.cpp b/tqtinterface/qt4/plugins/src/codecs/jp/main.cpp new file mode 100644 index 0000000..8b0f8f9 --- /dev/null +++ b/tqtinterface/qt4/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; +} + + +TQ_EXPORT_PLUGIN( JPTextCodecs ); -- cgit v1.2.1