]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/fontmap.cpp
fixed event processing for the target window
[wxWidgets.git] / src / common / fontmap.cpp
index 21a3e219e6db7f951120e4a50d0ef05d6bd27340..ca2eaa905ce915d7b76f5f25bfe6a37251977832 100644 (file)
@@ -88,6 +88,10 @@ static wxFontEncoding gs_encodings[] =
     wxFONTENCODING_ISO8859_14,
     wxFONTENCODING_ISO8859_15,
     wxFONTENCODING_KOI8,
+    wxFONTENCODING_CP932,
+    wxFONTENCODING_CP936,
+    wxFONTENCODING_CP949,
+    wxFONTENCODING_CP950,
     wxFONTENCODING_CP1250,
     wxFONTENCODING_CP1251,
     wxFONTENCODING_CP1252,
@@ -120,6 +124,10 @@ static const wxChar* gs_encodingDescs[] =
     wxTRANSLATE( "Celtic (ISO-8859-14)" ),
     wxTRANSLATE( "Western European with Euro (ISO-8859-15)" ),
     wxTRANSLATE( "KOI8-R" ),
+    wxTRANSLATE( "Windows Japanese (CP 932)" ),
+    wxTRANSLATE( "Windows Chinese Simplified (CP 936)" ),
+    wxTRANSLATE( "Windows Korean (CP 949)" ),
+    wxTRANSLATE( "Windows Chinese Traditional (CP 950)" ),
     wxTRANSLATE( "Windows Central European (CP 1250)" ),
     wxTRANSLATE( "Windows Cyrillic (CP 1251)" ),
     wxTRANSLATE( "Windows Western European (CP 1252)" ),
@@ -133,7 +141,7 @@ static const wxChar* gs_encodingDescs[] =
     wxTRANSLATE( "Unicode 8 bit (UTF-8)" ),
 };
 
-// and the internal names
+// and the internal names (these are not translated on purpose!)
 static const wxChar* gs_encodingNames[] =
 {
     wxT( "iso-8859-1" ),
@@ -152,6 +160,10 @@ static const wxChar* gs_encodingNames[] =
     wxT( "iso-8859-14" ),
     wxT( "iso-8859-15" ),
     wxT( "koi8-r" ),
+    wxT( "windows-932" ),
+    wxT( "windows-936" ),
+    wxT( "windows-949" ),
+    wxT( "windows-950" ),
     wxT( "windows-1250" ),
     wxT( "windows-1251" ),
     wxT( "windows-1252" ),
@@ -281,8 +293,8 @@ wxConfigBase *wxFontMapper::GetConfig()
         m_configIsDummy = FALSE;
         // FIXME: ideally, we should add keys from dummy config to the real one now,
         //        but it is a low-priority task because typical wxWin application
-        //        either doesn't use wxConfig at all or creates wxConfig object in 
-        //        wxApp::OnInit(), before any real interaction with the user takes 
+        //        either doesn't use wxConfig at all or creates wxConfig object in
+        //        wxApp::OnInit(), before any real interaction with the user takes
         //        place...
     }
 
@@ -385,7 +397,7 @@ wxString wxFontMapper::GetEncodingName(wxFontEncoding encoding)
     {
         if ( gs_encodings[i] == encoding )
         {
-            return wxGetTranslation(gs_encodingNames[i]);
+            return gs_encodingNames[i];
         }
     }
 
@@ -552,6 +564,25 @@ wxFontEncoding wxFontMapper::CharsetToEncoding(const wxString& charset,
                             encoding = (wxFontEncoding)value;
                         }
                     }
+
+                    switch ( value )
+                    {
+                        case 932:
+                            encoding = wxFONTENCODING_CP932;
+                            break;
+
+                        case 936:
+                            encoding = wxFONTENCODING_CP936;
+                            break;
+
+                        case 949:
+                            encoding = wxFONTENCODING_CP949;
+                            break;
+
+                        case 950:
+                            encoding = wxFONTENCODING_CP950;
+                            break;
+                    }
                 }
             }
         }
@@ -712,7 +743,8 @@ bool wxFontMapper::GetAltForEncoding(wxFontEncoding encoding,
         // wxFatalError doesn't return
     }
 
-    wxString configEntry, encName = GetEncodingName(encoding);
+    wxString configEntry,
+             encName = GetEncodingName(encoding);
     if ( !!facename )
     {
         configEntry = facename + _T("_");