pass ARCH down to uClibc
[buildroot.git] / package / libgtk12 / no-xwc.patch
blobe26bba8ed3f6bc81de72496dac8204d0afeca74c
1 remove mb and XWC support, as tinyx doesnt support this
4 # Patch managed by http://www.holgerschurig.de/patcher.html
7 --- gtk+-1.2.10/gdk/gdkdraw.c~no-xwc
8 +++ gtk+-1.2.10/gdk/gdkdraw.c
9 @@ -236,12 +236,14 @@
10 strlen (string) / 2);
13 +#ifdef HAVE_XWC
14 else if (font->type == GDK_FONT_FONTSET)
16 XFontSet fontset = (XFontSet) font_private->xfont;
17 XmbDrawString (drawable_private->xdisplay, drawable_private->xwindow,
18 fontset, gc_private->xgc, x, y, string, strlen (string));
20 +#endif
21 else
22 g_error("undefined font type\n");
24 @@ -291,12 +293,14 @@
25 gc_private->xgc, x, y, (XChar2b *) text, text_length / 2);
28 +#ifdef HAVE_XWC
29 else if (font->type == GDK_FONT_FONTSET)
31 XFontSet fontset = (XFontSet) font_private->xfont;
32 XmbDrawString (drawable_private->xdisplay, drawable_private->xwindow,
33 fontset, gc_private->xgc, x, y, text, text_length);
35 +#endif
36 else
37 g_error("undefined font type\n");
39 @@ -337,6 +341,7 @@
40 g_free (glyphs);
43 +#ifdef HAVE_XWC
44 else if (font->type == GDK_FONT_FONTSET)
46 if (sizeof(GdkWChar) == sizeof(wchar_t))
47 @@ -357,6 +362,7 @@
48 g_free (text_wchar);
51 +#endif
52 else
53 g_error("undefined font type\n");
55 --- gtk+-1.2.10/gdk/gdkim.c~no-xwc
56 +++ gtk+-1.2.10/gdk/gdkim.c
57 @@ -121,6 +121,7 @@
59 current_locale = setlocale (LC_ALL, NULL);
61 +#ifdef HAVE_XWC
62 if ((strcmp (current_locale, "C")) && (strcmp (current_locale, "POSIX")))
64 gdk_use_mb = TRUE;
65 @@ -145,7 +146,8 @@
66 GDK_NOTE (XIM,
67 g_message ("%s multi-byte string functions.",
68 gdk_use_mb ? "Using" : "Not using"));
70 +#endif
72 return current_locale;
75 @@ -1551,6 +1553,7 @@
76 else
77 length = len;
79 +#ifdef HAVE_XWC
80 if (gdk_use_mb)
82 XTextProperty tpr;
83 @@ -1589,6 +1592,7 @@
84 g_free (src_wc);
86 else
87 +#endif
89 gint i;
91 @@ -1644,6 +1648,7 @@
92 /* NoMem or LocaleNotSupp */
93 return -1;
95 +#ifdef HAVE_XWC
96 if (XwcTextPropertyToTextList (gdk_display, &tpr, &wstrs, &num_wstrs)
97 != Success)
99 @@ -1659,6 +1664,7 @@
100 dest[len_cpy] = wstr_src[len_cpy];
101 XwcFreeStringList (wstrs);
102 return len_cpy;
103 +#endif
105 else
107 --- gtk+-1.2.10/gdk/gdkfont.c~no-xwc
108 +++ gtk+-1.2.10/gdk/gdkfont.c
109 @@ -244,9 +244,11 @@
110 gdk_xid_table_remove (((XFontStruct *) private->xfont)->fid);
111 XFreeFont (private->xdisplay, (XFontStruct *) private->xfont);
112 break;
113 +#ifdef HAVE_XWC
114 case GDK_FONT_FONTSET:
115 XFreeFontSet (private->xdisplay, (XFontSet) private->xfont);
116 break;
117 +#endif
118 default:
119 g_error ("unknown font type.");
120 break;
121 @@ -292,6 +294,7 @@
122 return (((XFontStruct *) privatea->xfont)->fid ==
123 ((XFontStruct *) privateb->xfont)->fid);
125 +#ifdef HAVE_XWC
126 else if (fonta->type == GDK_FONT_FONTSET && fontb->type == GDK_FONT_FONTSET)
128 gchar *namea, *nameb;
129 @@ -301,6 +304,7 @@
131 return (strcmp(namea, nameb) == 0);
133 +#endif
134 else
135 /* fontset != font */
136 return FALSE;
137 @@ -333,10 +337,12 @@
138 width = XTextWidth16 (xfont, (XChar2b *) string, strlen (string) / 2);
140 break;
141 +#ifdef HAVE_XWC
142 case GDK_FONT_FONTSET:
143 fontset = (XFontSet) font_private->xfont;
144 width = XmbTextEscapement (fontset, string, strlen(string));
145 break;
146 +#endif
147 default:
148 width = 0;
150 @@ -372,10 +378,12 @@
151 width = XTextWidth16 (xfont, (XChar2b *) text, text_length / 2);
153 break;
154 +#ifdef HAVE_XWC
155 case GDK_FONT_FONTSET:
156 fontset = (XFontSet) private->xfont;
157 width = XmbTextEscapement (fontset, text, text_length);
158 break;
159 +#endif
160 default:
161 width = 0;
163 @@ -414,6 +422,7 @@
165 break;
167 +#ifdef HAVE_XWC
168 case GDK_FONT_FONTSET:
169 if (sizeof(GdkWChar) == sizeof(wchar_t))
171 @@ -431,6 +440,7 @@
172 g_free (text_wchar);
174 break;
175 +#endif
176 default:
177 width = 0;
179 @@ -474,10 +484,12 @@
180 width = XTextWidth (xfont, &character, 1);
182 break;
183 +#ifdef HAVE_XWC
184 case GDK_FONT_FONTSET:
185 fontset = (XFontSet) private->xfont;
186 width = XmbTextEscapement (fontset, &character, 1) ;
187 break;
188 +#endif
189 default:
190 width = 0;
192 @@ -523,6 +535,7 @@
194 break;
196 +#ifdef HAVE_XWC
197 case GDK_FONT_FONTSET:
198 fontset = (XFontSet) private->xfont;
200 @@ -530,6 +543,7 @@
201 width = XwcTextEscapement (fontset, &char_wc, 1) ;
203 break;
204 +#endif
205 default:
206 width = 0;
208 @@ -597,6 +611,7 @@
209 if (descent)
210 *descent = overall.descent;
211 break;
212 +#ifdef HAVE_XWC
213 case GDK_FONT_FONTSET:
214 fontset = (XFontSet) private->xfont;
215 XmbTextExtents (fontset, text, text_length, &ink, &logical);
216 @@ -611,6 +626,7 @@
217 if (descent)
218 *descent = ink.y + ink.height;
219 break;
220 +#endif
224 @@ -664,6 +680,7 @@
226 break;
228 +#ifdef HAVE_XWC
229 case GDK_FONT_FONTSET:
230 fontset = (XFontSet) private->xfont;
232 @@ -691,6 +708,7 @@
233 if (descent)
234 *descent = ink.y + ink.height;
235 break;
236 +#endif
240 @@ -750,11 +768,13 @@
242 width = overall.rbearing;
243 break;
244 +#ifdef HAVE_XWC
245 case GDK_FONT_FONTSET:
246 fontset = (XFontSet) private->xfont;
247 XmbTextExtents (fontset, text, text_length, &ink, &log);
248 width = ink.x + ink.width;
249 break;
250 +#endif
251 default:
252 width = 0;
254 @@ -818,11 +838,13 @@
256 height = overall.ascent + overall.descent;
257 break;
258 +#ifdef HAVE_XWC
259 case GDK_FONT_FONTSET:
260 fontset = (XFontSet) private->xfont;
261 XmbTextExtents (fontset, text, text_length, &ink, &log);
262 height = log.height;
263 break;
264 +#endif
265 default:
266 height = 0;