summaryrefslogtreecommitdiffstats
path: root/tqtinterface/qt4/plugins/src/codecs
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-07-10 15:17:53 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2011-07-10 15:17:53 -0500
commitdda8474928bd7276e1fad8fb7a601e7c83ff2bc2 (patch)
tree7f83910598b33b12730035f086df20b5a53ab99c /tqtinterface/qt4/plugins/src/codecs
parent6260b6178868c03aab1644bf93b0ef043654bdb0 (diff)
downloadexperimental-dda8474928bd7276e1fad8fb7a601e7c83ff2bc2.tar.gz
experimental-dda8474928bd7276e1fad8fb7a601e7c83ff2bc2.zip
Added TQt4 HEAD
Diffstat (limited to 'tqtinterface/qt4/plugins/src/codecs')
-rw-r--r--tqtinterface/qt4/plugins/src/codecs/cn/cn.pro18
-rw-r--r--tqtinterface/qt4/plugins/src/codecs/cn/main.cpp52
-rw-r--r--tqtinterface/qt4/plugins/src/codecs/codecs.pro5
-rw-r--r--tqtinterface/qt4/plugins/src/codecs/jp/jp.pro25
-rw-r--r--tqtinterface/qt4/plugins/src/codecs/jp/main.cpp56
-rw-r--r--tqtinterface/qt4/plugins/src/codecs/kr/kr.pro19
-rw-r--r--tqtinterface/qt4/plugins/src/codecs/kr/main.cpp47
-rw-r--r--tqtinterface/qt4/plugins/src/codecs/tw/main.cpp47
-rw-r--r--tqtinterface/qt4/plugins/src/codecs/tw/tw.pro18
9 files changed, 287 insertions, 0 deletions
diff --git a/tqtinterface/qt4/plugins/src/codecs/cn/cn.pro b/tqtinterface/qt4/plugins/src/codecs/cn/cn.pro
new file mode 100644
index 0000000..340df17
--- /dev/null
+++ b/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/tqtinterface/qt4/plugins/src/codecs/cn/main.cpp b/tqtinterface/qt4/plugins/src/codecs/cn/main.cpp
new file mode 100644
index 0000000..3c9064c
--- /dev/null
+++ b/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/tqtinterface/qt4/plugins/src/codecs/codecs.pro b/tqtinterface/qt4/plugins/src/codecs/codecs.pro
new file mode 100644
index 0000000..41775f7
--- /dev/null
+++ b/tqtinterface/qt4/plugins/src/codecs/codecs.pro
@@ -0,0 +1,5 @@
+TEMPLATE = subdirs
+
+!bigcodecs {
+ SUBDIRS += cn jp kr tw
+}
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 <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/tqtinterface/qt4/plugins/src/codecs/kr/kr.pro b/tqtinterface/qt4/plugins/src/codecs/kr/kr.pro
new file mode 100644
index 0000000..44c9109
--- /dev/null
+++ b/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/tqtinterface/qt4/plugins/src/codecs/kr/main.cpp b/tqtinterface/qt4/plugins/src/codecs/kr/main.cpp
new file mode 100644
index 0000000..fa76ad5
--- /dev/null
+++ b/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/tqtinterface/qt4/plugins/src/codecs/tw/main.cpp b/tqtinterface/qt4/plugins/src/codecs/tw/main.cpp
new file mode 100644
index 0000000..6991b33
--- /dev/null
+++ b/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/tqtinterface/qt4/plugins/src/codecs/tw/tw.pro b/tqtinterface/qt4/plugins/src/codecs/tw/tw.pro
new file mode 100644
index 0000000..da264b7
--- /dev/null
+++ b/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
+