summaryrefslogtreecommitdiff
path: root/source/l/gtk+/gtk+-1.2.10-encoding.patch
blob: 5b784a8daa57f598bf2e89f70d779485437fccc5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
--- gtk+-1.2.10/gtk/gtkrc.iso88593.encoding	Fri Jul 26 16:47:04 2002
+++ gtk+-1.2.10/gtk/gtkrc.iso88593	Fri Jul 26 16:47:04 2002
@@ -0,0 +1,8 @@
+style "gtk-default-iso-8859-3" {
+       fontset = "-*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-1,\
+                  -*-arial-medium-r-normal--12-*-*-*-*-*-iso8859-1,\
+		  -*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-3,\
+		  -*-arial-medium-r-normal--12-*-*-*-*-*-iso8859-3,*-r-*"
+}
+class "GtkWidget" style "gtk-default-iso-8859-3"
+
--- gtk+-1.2.10/gtk/Makefile.am.encoding	Fri Feb  2 12:09:02 2001
+++ gtk+-1.2.10/gtk/Makefile.am	Fri Jul 26 16:47:04 2002
@@ -374,10 +374,12 @@
 
 
 gtkconfdir = $(sysconfdir)/gtk
-gtkconf_DATA = gtkrc.az gtkrc.el gtkrc.eo gtkrc.he gtkrc.hy gtkrc.ja \
-	gtkrc.ko gtkrc.ru gtkrc.tr gtkrc.th gtkrc.uk gtkrc.iso-8859-2 \
-	gtkrc.iso-8859-5 gtkrc.iso-8859-13 gtkrc.iso-8859-14 \
-	gtkrc.iso-8859-15 gtkrc.zh_CN gtkrc.zh_TW.big5 \
+gtkconf_DATA = gtkrc.az gtkrc.he gtkrc.hy gtkrc.ja \
+	gtkrc.ko gtkrc.ru gtkrc.th gtkrc.uk \
+	gtkrc.utf8 gtkrc.iso88592 \
+	gtkrc.iso88593 gtkrc.iso88595 gtkrc.iso88597 \
+	gtkrc.iso88599 gtkrc.iso885913 gtkrc.iso885914 \
+	gtkrc.iso885915 gtkrc.zh_CN gtkrc.zh_TW.big5 \
 	gtkrc.ka_GE.georgianacademy gtkrc.ka_GE.georgianps \
 	gtkrc.vi_VN.tcvn gtkrc.vi_VN.viscii gtkrc.cp1251 gtkrc.cp1255
 
@@ -390,11 +392,11 @@
 	cd $(DESTDIR)$(gtkconfdir) && \
 	  for i in cs hr hu pl ro sk sl sq sr ; do \
 	    rm -f gtkrc.$$i ; \
-	    ln -s gtkrc.iso-8859-2 gtkrc.$$i ; \
+	    ln -s gtkrc.iso88592 gtkrc.$$i ; \
 	  done ; \
 	  for i in bg_BG.iso88595 mk sp ru_RU.iso88595 ; do \
 	    rm -f gtkrc.$$i ; \
-	    ln -s gtkrc.iso-8859-5 gtkrc.$$i ; \
+	    ln -s gtkrc.iso88595 gtkrc.$$i ; \
 	  done ; \
 	  for i in he_IL.cp1255 he_IL.microsoftcp1255 yi ; do \
 	    rm -f gtkrc.$$i ; \
@@ -403,12 +405,12 @@
 	rm -f gtkrc.lt gtkrc.lv gtkrc.cy gtkrc.ga gtkrc.et gtkrc.ka \
 	     gtkrc.vi_VN.viscii111 gtkrc.vi_VN.tcvn5712 gtkrc.vi \
 	     gtkrc.be gtkrc.bg gtkrc.mi ; \
-	ln -s gtkrc.iso-8859-13 gtkrc.mi ; \
-	ln -s gtkrc.iso-8859-13 gtkrc.lt ; \
-	ln -s gtkrc.iso-8859-13 gtkrc.lv ; \
-	ln -s gtkrc.iso-8859-14 gtkrc.cy ; \
-	ln -s gtkrc.iso-8859-14 gtkrc.ga ; \
-	ln -s gtkrc.iso-8859-15 gtkrc.et ; \
+	ln -s gtkrc.iso885913 gtkrc.mi ; \
+	ln -s gtkrc.iso885913 gtkrc.lt ; \
+	ln -s gtkrc.iso885913 gtkrc.lv ; \
+	ln -s gtkrc.iso885914 gtkrc.cy ; \
+	ln -s gtkrc.iso885914 gtkrc.ga ; \
+	ln -s gtkrc.iso885915 gtkrc.et ; \
 	ln -s gtkrc.ka_GE.georgianps gtkrc.ka ; \
 	ln -s gtkrc.vi_VN.viscii gtkrc.vi_VN.viscii111 ; \
 	ln -s gtkrc.vi_VN.tcvn gtkrc.vi ; \
--- gtk+-1.2.10/gtk/gtkrc.c.encoding	Thu Mar 15 13:41:40 2001
+++ gtk+-1.2.10/gtk/gtkrc.c	Fri Jul 26 16:49:24 2002
@@ -33,6 +33,7 @@
 #include <string.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <langinfo.h>
 
 #include "gtkrc.h"
 #include "gtkbindings.h"
@@ -440,7 +441,7 @@
 void
 gtk_rc_init (void)
 {
-  static gchar *locale_suffixes[3];
+  static gchar *locale_suffixes[8];
   static gint n_locale_suffixes = 0;
 
   gint i, j;
@@ -449,9 +450,7 @@
 
   if (!initted)
     {
-      gint length;
-      
-      char *locale = setlocale (LC_CTYPE, NULL);
+      char *locale = g_strdup (setlocale (LC_CTYPE, NULL));
       char *p;
       
       initted = TRUE;
@@ -470,39 +469,88 @@
 	   * We normalize the charset into a standard form,
 	   * which has all '-' and '_' characters removed,
 	   * and is lowercase.
+	   *
+	   * the search is done in that order:
+	   * gtkrc.ll_cc.lowercasecodeset
+	   * gtkrc.ll_cc.normalizedcodeset
+	   * gtkrc.ll.lowercasecodeset
+	   * gtkrc.ll.normalizedcodeset
+	   * gtkrc.lowercasecodeset
+	   * gtkrc.normalizedcodeset
+	   * gtkrc.ll_cc
+	   * gtkrc.ll
+	   * 
 	   */
-	  gchar *normalized_locale;
+	  char *codeset = NULL;
+	  char *normalized_codeset = NULL;
+	  char *cc = NULL;
+	  char *ll;
 
 	  p = strchr (locale, '@');
-	  length = p ? (p -locale) : strlen (locale);
+	  if (p)
+	    *p = '\0';
 
+	  codeset = nl_langinfo (CODESET);
+	  
 	  p = strchr (locale, '.');
+	  if (!codeset && p)
+	    codeset = p + 1;
 	  if (p)
+	    *p = '\0';
+	  
+	  if (codeset)
 	    {
-	      gchar *tmp1 = g_strndup (locale, p - locale + 1);
-	      gchar *tmp2 = _gtk_normalize_codeset (p + 1, length - (p - locale + 1));
+	      codeset = g_strdup (codeset);
 	      
-	      normalized_locale = g_strconcat (tmp1, tmp2, NULL);
-	      g_free (tmp1);
-	      g_free (tmp2);
-						 
-	      locale_suffixes[n_locale_suffixes++] = g_strdup (normalized_locale);
-	      length = p - locale;
+	      p = codeset;
+	      while (*p)
+		{
+		  /* tolower not used, because some locales are not
+		   * compatible with C locale in lowercasing ascii
+		   */
+		  if (*p >= 'A' && *p <= 'Z')
+		    *p = (*p) - 'A' + 'a';
+		  p++;
+		}
+	      
+	      normalized_codeset = _gtk_normalize_codeset(codeset, strlen (codeset));
+	      if (strcmp (normalized_codeset, codeset) == 0)
+		{
+		  g_free (normalized_codeset);
+		  normalized_codeset = NULL;
+		}
 	    }
-	  else
-	    normalized_locale = g_strndup (locale, length);
 	  
-	  p = strchr (normalized_locale, '_');
+	  p = strchr (locale, '_');
 	  if (p)
 	    {
-	      locale_suffixes[n_locale_suffixes++] = g_strndup (normalized_locale, length);
-	      length = p - normalized_locale;
+	      cc = p + 1;
+	      *p = '\0';
 	    }
-	  
-	  locale_suffixes[n_locale_suffixes++] = g_strndup (normalized_locale, length);
 
-	  g_free (normalized_locale);
+	  ll = locale;	
+	
+	  if (cc && codeset)
+	    locale_suffixes[n_locale_suffixes++] = g_strconcat (ll, "_", cc, ".", codeset, NULL);
+          if (cc && normalized_codeset)
+	    locale_suffixes[n_locale_suffixes++] = g_strconcat (ll, "_", cc, ".", normalized_codeset, NULL);
+	  if (codeset)
+            locale_suffixes[n_locale_suffixes++] = g_strconcat (ll, ".", codeset, NULL);
+          if (normalized_codeset)
+	    locale_suffixes[n_locale_suffixes++] = g_strconcat (ll, ".", normalized_codeset, NULL);
+	  if (codeset)
+	    locale_suffixes[n_locale_suffixes++] = g_strdup (codeset);
+	  if (normalized_codeset)
+	    locale_suffixes[n_locale_suffixes++] = g_strdup (normalized_codeset);
+	  if (cc)
+            locale_suffixes[n_locale_suffixes++] = g_strconcat (ll, "_", cc, NULL);
+	  locale_suffixes[n_locale_suffixes++] = g_strdup (ll);
+
+	  g_free (normalized_codeset);
+	  g_free (codeset);
 	}
+
+      g_free (locale);
     }
   
   i = 0;
--- gtk+-1.2.10/gtk/gtkrc.iso88599.encoding	Fri Jul 26 16:47:04 2002
+++ gtk+-1.2.10/gtk/gtkrc.iso88599	Fri Jul 26 16:47:04 2002
@@ -0,0 +1,8 @@
+style "gtk-default-iso-8859-9" {
+       fontset = "-*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-1,\
+                  -*-arial-medium-r-normal--12-*-*-*-*-*-iso8859-1,\
+		  -*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-9,\
+		  -*-arial-medium-r-normal--12-*-*-*-*-*-iso8859-9,*-r-*"
+}
+class "GtkWidget" style "gtk-default-iso-8859-9"
+
--- gtk+-1.2.10/gtk/gtkrc.utf8.encoding	Fri Jul 26 16:47:04 2002
+++ gtk+-1.2.10/gtk/gtkrc.utf8	Fri Jul 26 16:47:04 2002
@@ -0,0 +1,7 @@
+style "default-text" {
+       fontset = "-*-helvetica-medium-r-normal--*-120-*-*-p-*-*-*"
+
+}
+
+class "GtkWidget" style "default-text"
+
--- gtk+-1.2.10/gtk/gtkrc.iso885913.encoding	Fri Jul 26 16:47:04 2002
+++ gtk+-1.2.10/gtk/gtkrc.iso885913	Fri Jul 26 16:47:04 2002
@@ -0,0 +1,7 @@
+style "gtk-default-iso-8859-13" {
+       fontset = "-*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-1,\
+                  -*-arial-medium-r-normal--12-*-*-*-*-*-iso8859-1,\
+		  -*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-13,\
+		  -*-arial-medium-r-normal--12-*-*-*-*-*-iso8859-13,*-r-*"
+}
+class "GtkWidget" style "gtk-default-iso-8859-13"
--- gtk+-1.2.10/gtk/gtkrc.iso885914.encoding	Fri Jul 26 16:47:04 2002
+++ gtk+-1.2.10/gtk/gtkrc.iso885914	Fri Jul 26 16:47:04 2002
@@ -0,0 +1,8 @@
+style "gtk-default-iso-8859-14" {
+       fontset = "-*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-1,\
+                  -*-arial-medium-r-normal--12-*-*-*-*-*-iso8859-1,\
+		  -*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-14,\
+		  -*-arial-medium-r-normal--12-*-*-*-*-*-iso8859-14,*-r-*"
+}
+class "GtkWidget" style "gtk-default-iso-8859-14"
+
--- gtk+-1.2.10/gtk/gtkrc.iso885915.encoding	Fri Jul 26 16:47:04 2002
+++ gtk+-1.2.10/gtk/gtkrc.iso885915	Fri Jul 26 16:47:04 2002
@@ -0,0 +1,8 @@
+style "gtk-default-iso-8859-15" {
+       fontset = "-*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-1,\
+                  -*-arial-medium-r-normal--12-*-*-*-*-*-iso8859-1,\
+		  -*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-15,\
+		  -*-arial-medium-r-normal--12-*-*-*-*-*-iso8859-15,*-r-*"
+}
+class "GtkWidget" style "gtk-default-iso-8859-15"
+
--- gtk+-1.2.10/gtk/gtkrc.iso88592.encoding	Fri Jul 26 16:47:04 2002
+++ gtk+-1.2.10/gtk/gtkrc.iso88592	Fri Jul 26 16:47:04 2002
@@ -0,0 +1,14 @@
+#$(gtkconfigdir)/gtkrc.iso-8859-2
+#
+# This file defines the fontsets for iso-8859-2 encoding
+# make symliks or hardlinks to gtkrc.$LANG if your language uses iso-8859-2
+# and a gtkrc.$LANG doesn't exist yet.
+
+style  "gtk-default-iso-8859-2" {
+       fontset = "-*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-1,\
+                  -*-arial-medium-r-normal--12-*-*-*-*-*-iso8859-1,\
+		  -*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-2,\
+		  -*-arial-medium-r-normal--12-*-*-*-*-*-iso8859-2,*-r-*"
+}
+class "GtkWidget" style "gtk-default-iso-8859-2"
+
--- gtk+-1.2.10/gtk/gtkrc.iso88595.encoding	Fri Jul 26 16:47:04 2002
+++ gtk+-1.2.10/gtk/gtkrc.iso88595	Fri Jul 26 16:47:04 2002
@@ -0,0 +1,14 @@
+#$(gtkconfigdir)/gtkrc.iso-8859-5
+#
+# This file defines the fontsets for iso-8859-5 encoding
+# make symliks or hardlinks to gtkrc.$LANG if your language uses iso-8859-5
+# and a gtkrc.$LANG doesn't exist yet.
+
+style "gtk-default-iso-8859-5" {
+       fontset = "-*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-1,\
+                  -*-arial-medium-r-normal--12-*-*-*-*-*-iso8859-1,\
+		  -*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-5,\
+		  -*-arial-medium-r-normal--12-*-*-*-*-*-iso8859-5,*-r-*"
+}
+class "GtkWidget" style "gtk-default-iso-8859-5"
+
--- gtk+-1.2.10/gtk/gtkrc.iso88597.encoding	Fri Jul 26 16:47:04 2002
+++ gtk+-1.2.10/gtk/gtkrc.iso88597	Fri Jul 26 16:47:04 2002
@@ -0,0 +1,8 @@
+style "gtk-default-iso-8859-7" {
+       fontset = "-*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-1,\
+		  -*-arial-medium-r-normal--12-*-*-*-*-*-iso8859-1,\
+		  -*-helvetica-medium-r-normal--12-*-*-*-*-*-iso8859-7,\
+		  -*-arial-medium-r-normal--12-*-*-*-*-*-iso8859-7,*-r-*"
+}
+class "GtkWidget" style "gtk-default-iso-8859-7"
+