diff options
author | Suren A. Chilingaryan <csa@suren.me> | 2019-09-01 00:00:32 +0200 |
---|---|---|
committer | Suren A. Chilingaryan <csa@suren.me> | 2019-09-01 00:00:32 +0200 |
commit | ca9627e70852f6b2e835660df870fe3ab405882d (patch) | |
tree | 0a008b1d5b16fa0679a195ed7b5662c7891f591c /x11-libs/gtk+/files/gtk+-1.2.10-rh-encoding.patch | |
download | darklin4-ca9627e70852f6b2e835660df870fe3ab405882d.tar.gz darklin4-ca9627e70852f6b2e835660df870fe3ab405882d.tar.bz2 darklin4-ca9627e70852f6b2e835660df870fe3ab405882d.tar.xz darklin4-ca9627e70852f6b2e835660df870fe3ab405882d.zip |
Initial import
Diffstat (limited to 'x11-libs/gtk+/files/gtk+-1.2.10-rh-encoding.patch')
-rw-r--r-- | x11-libs/gtk+/files/gtk+-1.2.10-rh-encoding.patch | 148 |
1 files changed, 148 insertions, 0 deletions
diff --git a/x11-libs/gtk+/files/gtk+-1.2.10-rh-encoding.patch b/x11-libs/gtk+/files/gtk+-1.2.10-rh-encoding.patch new file mode 100644 index 0000000..ca645f3 --- /dev/null +++ b/x11-libs/gtk+/files/gtk+-1.2.10-rh-encoding.patch @@ -0,0 +1,148 @@ +--- 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" ++ |